adjustlinkrev: prepare source revs for ancestry only once
We'll need some more complex initialisation to handle workingfilectx
case. We do this small change in a different patch for clarity.
--- a/mercurial/context.py Thu Mar 19 19:52:23 2015 -0700
+++ b/mercurial/context.py Thu Mar 19 23:52:26 2015 -0700
@@ -774,13 +774,13 @@
# hack to reuse ancestor computation when searching for renames
memberanc = getattr(self, '_ancestrycontext', None)
iteranc = None
+ revs = [srcrev]
if memberanc is None:
- memberanc = iteranc = cl.ancestors([srcrev], lkr,
- inclusive=inclusive)
+ memberanc = iteranc = cl.ancestors(revs, lkr, inclusive=inclusive)
# check if this linkrev is an ancestor of srcrev
if lkr not in memberanc:
if iteranc is None:
- iteranc = cl.ancestors([srcrev], lkr, inclusive=inclusive)
+ iteranc = cl.ancestors(revs, lkr, inclusive=inclusive)
for a in iteranc:
ac = cl.read(a) # get changeset data (we avoid object creation)
if path in ac[3]: # checking the 'files' field.