commit: use revlog.commonancestors instead of .ancestor
authorMads Kiilerich <madski@unity3d.com>
Mon, 07 Apr 2014 23:17:51 +0200
changeset 20987 298c9f346dde
parent 20986 6ae0c41e4b52
child 20988 8c2f1e2a11ff
commit: use revlog.commonancestors instead of .ancestor This do probably not make any real difference but is slightly more correct and we would like to get rid of flog.ancestor.
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Mon Apr 07 23:17:51 2014 +0200
+++ b/mercurial/localrepo.py	Mon Apr 07 23:17:51 2014 +0200
@@ -1154,10 +1154,10 @@
             fparent1, fparent2 = fparent2, nullid
         elif fparent2 != nullid:
             # is one parent an ancestor of the other?
-            fparentancestor = flog.ancestor(fparent1, fparent2)
-            if fparentancestor == fparent1:
+            fparentancestors = flog.commonancestors(fparent1, fparent2)
+            if fparent1 in fparentancestors:
                 fparent1, fparent2 = fparent2, nullid
-            elif fparentancestor == fparent2:
+            elif fparent2 in fparentancestors:
                 fparent2 = nullid
 
         # is the file changed?