# HG changeset patch # User Matt Mackall # Date 2012-03-26 21:41:54 # Node ID 2b0a406d3043b0895b0267a9616b5e65ea33f952 # Parent 531e69ff348fc7fb6e23d9f07b594a50c5baf879 merge: fix unknown file merge detection for case-folding systems This was triggering some test failures on Mac. diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -84,6 +84,7 @@ class mergestate(object): def _checkunknownfile(repo, wctx, mctx, f): return (not repo.dirstate._ignore(f) and os.path.exists(repo.wjoin(f)) + and repo.dirstate.normalize(f) not in repo.dirstate and mctx[f].cmp(wctx[f])) def _checkunknown(repo, wctx, mctx): @@ -545,8 +546,6 @@ 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 " @@ -570,6 +569,8 @@ def update(repo, node, branchmerge, forc folding = not util.checkcase(repo.path) if folding: _checkcollision(p2, branchmerge and p1) + if not force: + _checkunknown(repo, wc, p2) action += _forgetremoved(wc, p2, branchmerge) action += manifestmerge(repo, wc, p2, pa, overwrite, partial) diff --git a/tests/test-casefolding.t b/tests/test-casefolding.t --- a/tests/test-casefolding.t +++ b/tests/test-casefolding.t @@ -66,7 +66,7 @@ no clobbering of untracked files with wr 0 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo gold > a $ hg up - a: untracked file differs + A: untracked file differs abort: untracked files in working directory differ from files in requested revision [255] $ cat a