# HG changeset patch # User Matt Mackall # Date 2011-04-04 20:25:20 # Node ID 9d67277c9204fea7aaf6dcb03fe053c190d154a8 # Parent 02c3d4d44a92515ebcae8743bcb872f63ebbb9f7 merge: add ancestor to the update function This makes it easier to do rebase-like operations. diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -439,7 +439,7 @@ def recordupdates(repo, action, branchme if f: repo.dirstate.forget(f) -def update(repo, node, branchmerge, force, partial): +def update(repo, node, branchmerge, force, partial, ancestor=None): """ Perform a merge between the working directory and the given node @@ -492,7 +492,11 @@ def update(repo, node, branchmerge, forc overwrite = force and not branchmerge pl = wc.parents() p1, p2 = pl[0], repo[node] - pa = p1.ancestor(p2) + if ancestor: + pa = repo[ancestor] + else: + pa = p1.ancestor(p2) + fp1, fp2, xp1, xp2 = p1.node(), p2.node(), str(p1), str(p2) ### check phase