changeset 13874:9d67277c9204

merge: add ancestor to the update function This makes it easier to do rebase-like operations.
author Matt Mackall <mpm@selenic.com>
date Mon, 04 Apr 2011 15:25:20 -0500
parents 02c3d4d44a92
children ff3c683eb8ff
files mercurial/merge.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/merge.py	Mon Apr 04 14:21:54 2011 -0500
+++ b/mercurial/merge.py	Mon Apr 04 15:25:20 2011 -0500
@@ -439,7 +439,7 @@
                 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 @@
         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