changeset 11454:9b0406b23be0 stable

merge: pass constant cset ancestor to fctx.ancestor
author Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
date Fri, 18 Jun 2010 08:49:24 +0200
parents 2ee26044d846
children 3827728b54e2
files mercurial/merge.py
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/merge.py	Fri Jun 18 08:48:05 2010 +0200
+++ b/mercurial/merge.py	Fri Jun 18 08:49:24 2010 +0200
@@ -242,8 +242,13 @@
 def actionkey(a):
     return a[1] == 'r' and -1 or 0, a
 
-def applyupdates(repo, action, wctx, mctx):
-    "apply the merge action list to the working directory"
+def applyupdates(repo, action, wctx, mctx, actx):
+    """apply the merge action list to the working directory
+
+    wctx is the working copy context
+    mctx is the context to be merged into the working copy
+    actx is the context of the common ancestor
+    """
 
     updated, merged, removed, unresolved = 0, 0, 0, 0
     ms = mergestate(repo)
@@ -263,7 +268,7 @@
             repo.ui.debug("preserving %s for resolve of %s\n" % (f, fd))
             fcl = wctx[f]
             fco = mctx[f2]
-            fca = fcl.ancestor(fco) or repo.filectx(f, fileid=nullrev)
+            fca = fcl.ancestor(fco, actx) or repo.filectx(f, fileid=nullrev)
             ms.add(fcl, fco, fca, fd, flags)
             if f != fd and move:
                 moves.append(f)
@@ -505,7 +510,7 @@
         if not partial:
             repo.hook('preupdate', throw=True, parent1=xp1, parent2=xp2)
 
-        stats = applyupdates(repo, action, wc, p2)
+        stats = applyupdates(repo, action, wc, p2, pa)
 
         if not partial:
             repo.dirstate.setparents(fp1, fp2)