linkrev: also adjust linkrev when bootstrapping 'follow' revset
authorPierre-Yves David <pierre-yves.david@fb.com>
Mon, 29 Dec 2014 23:40:24 -0800
changeset 23704 c624fb2c4239
parent 23703 aaa76612b3c0
child 23705 28a302e9225d
linkrev: also adjust linkrev when bootstrapping 'follow' revset The follow revset (used by `hg log --follow`) now uses the new 'introrev' method to bootstrap its traversal. This catches issues from linkrev-shadowing of the changesets introducing the version of a file in source changeset. A new test has been added to display pathological cases. Another test is affected because it was meant to test this behavior but actually failed to do so for half of the output. The output are now similar.
mercurial/revset.py
tests/test-log.t
--- a/mercurial/revset.py	Tue Dec 23 16:14:39 2014 -0800
+++ b/mercurial/revset.py	Mon Dec 29 23:40:24 2014 -0800
@@ -807,7 +807,7 @@
             cx = c[x]
             s = set(ctx.rev() for ctx in cx.ancestors(followfirst=followfirst))
             # include the revision responsible for the most recent version
-            s.add(cx.linkrev())
+            s.add(cx.introrev())
         else:
             return baseset()
     else:
--- a/tests/test-log.t	Tue Dec 23 16:14:39 2014 -0800
+++ b/tests/test-log.t	Mon Dec 29 23:40:24 2014 -0800
@@ -1559,7 +1559,7 @@
   o  a
   
   $ hg log -f d/a -T '{desc}' -G
-  o  b
+  @  c
   |
   o  a
   
@@ -1656,4 +1656,21 @@
      date:        Thu Jan 01 00:00:00 1970 +0000
      summary:     content1
   
+
+hg log -f from the grafted changeset
+(The bootstrap should properly take the topology in account)
+
+  $ hg up 'desc(content3)^'
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg log -Gf a
+  @  changeset:   3:15b2327059e5
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     content2
+  |
+  o  changeset:   0:ae0a3c9f9e95
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     content1
+  
   $ cd ..