adjustlinkrev: prepare source revs for ancestry only once stable
authorPierre-Yves David <pierre-yves.david@fb.com>
Thu, 19 Mar 2015 23:52:26 -0700
branchstable
changeset 24410 86de531e07e1
parent 24407 dd01834a696f
child 24411 5a12ef618c03
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.
mercurial/context.py
--- 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.