diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -807,7 +807,7 @@ def _follow(repo, subset, x, name, follo 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: diff --git a/tests/test-log.t b/tests/test-log.t --- a/tests/test-log.t +++ b/tests/test-log.t @@ -1559,7 +1559,7 @@ hg log -f dir across branches o a $ hg log -f d/a -T '{desc}' -G - o b + @ c | o a @@ -1656,4 +1656,21 @@ plain log lists the original version 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 ..