diff mercurial/merge.py @ 18605:bcf29565d89f

manifestmerge: pass in branchmerge and force separately This will be used in an upcoming patch.
author Siddharth Agarwal <sid0@fb.com>
date Fri, 08 Feb 2013 15:23:23 +0000
parents d0a8f09a22eb
children 95773237df7f
line wrap: on
line diff
--- a/mercurial/merge.py	Sat Feb 09 15:43:02 2013 +0000
+++ b/mercurial/merge.py	Fri Feb 08 15:23:23 2013 +0000
@@ -185,14 +185,15 @@
 
     return actions
 
-def manifestmerge(repo, p1, p2, pa, overwrite, partial):
+def manifestmerge(repo, p1, p2, pa, branchmerge, force, partial):
     """
     Merge p1 and p2 with ancestor pa and generate merge action list
 
-    overwrite = whether we clobber working files
+    branchmerge and force are as passed in to update
     partial = function to filter file lists
     """
 
+    overwrite = force and not branchmerge
     actions, copy, movewithdir = [], {}, {}
 
     if overwrite:
@@ -208,8 +209,8 @@
             actions.append((of, "rd", (fl,), "rename and delete"))
 
     repo.ui.note(_("resolving manifests\n"))
-    repo.ui.debug(" overwrite: %s, partial: %s\n"
-                  % (bool(overwrite), bool(partial)))
+    repo.ui.debug(" branchmerge: %s, force: %s, partial: %s\n"
+                  % (bool(branchmerge), bool(force), bool(partial)))
     repo.ui.debug(" ancestor: %s, local: %s, remote: %s\n" % (pa, p1, p2))
 
     m1, m2, ma = p1.manifest(), p2.manifest(), pa.manifest()
@@ -452,7 +453,7 @@
         actions += _forgetremoved(tctx, mctx, branchmerge)
     actions += manifestmerge(repo, tctx, mctx,
                              ancestor,
-                             force and not branchmerge,
+                             branchmerge, force,
                              partial)
     return actions