# HG changeset patch # User Matt Mackall # Date 2012-02-09 23:54:47 # Node ID 3eab42088be44f42e0bad9840ded8cd79ff7a19c # Parent 0776a6cababeabd87dbceaee207710ca760d4fa9 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. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -5723,6 +5723,7 @@ def update(ui, repo, node=None, rev=None 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) diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -545,6 +545,8 @@ def update(repo, node, branchmerge, forc 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 @@ def update(repo, node, branchmerge, forc ### 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)