[PATCH] log: fix log -f slow path to actually follow history

Durham Goode durham at fb.com
Fri Dec 5 22:54:30 UTC 2014


# HG changeset patch
# User Durham Goode <durham at fb.com>
# Date 1417818452 28800
#      Fri Dec 05 14:27:32 2014 -0800
# Node ID 96d916622019f448bd012884ee4fd78fe8dc63ba
# Parent  406dfc63a1ad71213dccc1a45de99a3c5d5ac460
log: fix log -f slow path to actually follow history

log -f was using ':.' instead of '::.' so it wasn't actually following history.
This fixes it and adds a test. It's been broken for years, so I guess it wasn't
that big of a deal...

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1836,7 +1836,7 @@ def getgraphlogrevs(repo, pats, opts):
         possiblyunsorted = True
     else:
         if follow and len(repo) > 0:
-            revs = repo.revs('reverse(:.)')
+            revs = repo.revs('reverse(::.)')
         else:
             revs = revset.spanset(repo)
             revs.reverse()
@@ -1880,7 +1880,7 @@ def getlogrevs(repo, pats, opts):
     if opts.get('rev'):
         revs = scmutil.revrange(repo, opts['rev'])
     elif follow:
-        revs = repo.revs('reverse(:.)')
+        revs = repo.revs('reverse(::.)')
     else:
         revs = revset.spanset(repo)
         revs.reverse()
diff --git a/tests/test-log.t b/tests/test-log.t
--- a/tests/test-log.t
+++ b/tests/test-log.t
@@ -1543,3 +1543,19 @@ issue3772: hg log -r :null showing revis
   
 
   $ cd ..
+
+hg log -f dir across branches
+
+  $ hg init acrossbranches
+  $ cd acrossbranches
+  $ mkdir d
+  $ echo a > d/a && hg ci -Aqm a
+  $ echo b > d/b && hg ci -Aqm b
+  $ hg up -q 0
+  $ echo c > d/c && hg ci -Aqm c
+  $ hg log -f d -T '{desc}' -G
+  @  c
+  |
+  o  a
+  
+  $ cd ..


More information about the Mercurial-devel mailing list