diff mercurial/cmdutil.py @ 24064:c260887cdbcd

log: fix --follow null parent not to include revision 0 If p1 is null, ':.' is translated as '0:null'. But rangeset can't handle null, only revision 0 was visible. Because 'null' should not be listed implicitly, "log --follow" (without -r) should be empty if p1 is null. Test of "hg grep -f" is added for cmdutil.walkchangerevs().
author Yuya Nishihara <yuya@tcha.org>
date Fri, 06 Feb 2015 21:53:39 +0900
parents c98fa0ca4678
children afed5d2e7985
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Fri Feb 06 00:22:20 2015 +0900
+++ b/mercurial/cmdutil.py	Fri Feb 06 21:53:39 2015 +0900
@@ -1821,6 +1821,8 @@
     follow = opts.get('follow') or opts.get('follow_first')
     if opts.get('rev'):
         revs = scmutil.revrange(repo, opts['rev'])
+    elif follow and repo.dirstate.p1() == nullid:
+        revs = revset.baseset()
     elif follow:
         revs = repo.revs('reverse(:.)')
     else: