Mercurial > public > mercurial-scm > hg-stable
diff mercurial/cmdutil.py @ 30018:2963fba2d18a
log: copy the way of ancestor traversal to --follow matcher (issue5376)
We can't use fctx.linkrev() because follow() revset tries hard to simulate
the traversal of changelog DAG, not filelog DAG. This patch fixes
_makefollowlogfilematcher() to walk file ancestors in the same way as
revset._follow().
I'll factor out a common function in future patches.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 24 Sep 2016 19:58:23 +0900 |
parents | 96b2dd3b184d |
children | 3dcaf1c4e90d |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Sat Sep 24 19:52:02 2016 +0900 +++ b/mercurial/cmdutil.py Sat Sep 24 19:58:23 2016 +0900 @@ -1941,7 +1941,7 @@ # --follow, we want the names of the ancestors of FILE in the # revision, stored in "fcache". "fcache" is populated by # reproducing the graph traversal already done by --follow revset - # and relating linkrevs to file names (which is not "correct" but + # and relating revs to file names (which is not "correct" but # good enough). fcache = {} fcacheready = [False] @@ -1950,9 +1950,9 @@ def populate(): for fn in files: fctx = pctx[fn] - fcache.setdefault(fctx.linkrev(), set()).add(fctx.path()) + fcache.setdefault(fctx.introrev(), set()).add(fctx.path()) for c in fctx.ancestors(followfirst=followfirst): - fcache.setdefault(c.linkrev(), set()).add(c.path()) + fcache.setdefault(c.rev(), set()).add(c.path()) def filematcher(rev): if not fcacheready[0]: