merge: pass constant cset ancestor to fctx.ancestor

This commit is contained in:
Peter Arrenbrecht 2010-06-18 08:49:24 +02:00
parent 3ecec5f671
commit a5728c19b7

View File

@ -242,8 +242,13 @@ def manifestmerge(repo, p1, p2, pa, overwrite, partial):
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 @@ def applyupdates(repo, action, wctx, mctx):
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 @@ def update(repo, node, branchmerge, force, partial):
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)