diff mercurial/merge.py @ 16095:3eab42088be4

update: just merge unknown file collisions The unknown file collision rule was introduced as an extension of the "should be clean when merging" rule. Unfortunately, it got applied to the normal update path, which should be happy to merge local changes. This patch gives us merges for unknown file collisions on update, while preserving abort for merge and update -c.
author Matt Mackall <mpm@selenic.com>
date Thu, 09 Feb 2012 17:54:47 -0600
parents 0776a6cababe
children c12d4aceba79
line wrap: on
line diff
--- a/mercurial/merge.py	Thu Feb 09 17:04:17 2012 -0600
+++ b/mercurial/merge.py	Thu Feb 09 17:54:47 2012 -0600
@@ -545,6 +545,8 @@
             if not force and (wc.files() or wc.deleted()):
                 raise util.Abort(_("outstanding uncommitted changes"),
                                  hint=_("use 'hg status' to list changes"))
+            if not force:
+                _checkunknown(repo, wc, p2)
             for s in wc.substate:
                 if wc.sub(s).dirty():
                     raise util.Abort(_("outstanding uncommitted changes in "
@@ -566,8 +568,6 @@
         ### calculate phase
         action = []
         folding = not util.checkcase(repo.path)
-        if not force:
-            _checkunknown(repo, wc, p2)
         if folding:
             _checkcollision(p2, branchmerge and p1)
         action += _forgetremoved(wc, p2, branchmerge)