dagop: change visit dict of filectxancestors() indexed solely by rev
In future patches, a max heap will be used to compute the next revision
to visit.
dagop: use fctx.rev() consistently in filectxancestors()
We can't use fctx.linkrev() to sort fctxs coming from multiple files.
This was changed at
24b57c3899f8 due to performance issue, but we know
we evaluate parent.rev() in revset anyway.
dagop: yield intro filectx by filectxancestors()
This is the convention of dagop.*ancestors() functions.
dagop: copy basefilectx.ancestors() to free function
The primary goal of this series is to make follow() support multiple start
revisions.
dagop.filectxancestors() will be extended to take multiple filectxs.
basefilectx.ancestors() is not forwarded to this function because doing that
would resurrect the performance issue fixed by
24b57c3899f8.
test-log: test that fctx.ancestors() can't index parents only by linkrev
This covers a possible bug that could be caused by the following change:
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1047,7 +1047,7 @@ class basefilectx(object):
while True:
for parent in c.parents()[:cut]:
- visit[(parent.linkrev(), parent.filenode())] = parent
+ visit[parent.linkrev()] = parent
if not visit:
break
c = visit.pop(max(visit))