# HG changeset patch # User Peter Arrenbrecht # Date 1276843764 -7200 # Node ID 9b0406b23be022a12b0b1173a0e3c50e0f6c65e9 # Parent 2ee26044d8466497e7c2d269af307d6a3ced9b7c merge: pass constant cset ancestor to fctx.ancestor diff -r 2ee26044d846 -r 9b0406b23be0 mercurial/merge.py --- 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)