changeset 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 b8be450638f6
files mercurial/commands.py mercurial/merge.py
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Thu Feb 09 17:04:17 2012 -0600
+++ b/mercurial/commands.py	Thu Feb 09 17:54:47 2012 -0600
@@ -5723,6 +5723,7 @@
             raise util.Abort(_("uncommitted local changes"))
         if not rev:
             rev = repo[repo[None].branch()].rev()
+        mergemod._checkunknown(repo, repo[None], repo[rev])
 
     if clean:
         ret = hg.clean(repo, rev)
--- 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)