diff -r 2ebe3d0ce91d -r d550168f11ce mercurial/merge.py --- a/mercurial/merge.py Fri Dec 16 21:09:41 2011 +0900 +++ b/mercurial/merge.py Fri Dec 16 21:21:27 2011 +0900 @@ -96,7 +96,7 @@ raise util.Abort(_("untracked file in working directory differs" " from file in requested revision: '%s'") % fn) -def _checkcollision(mctx): +def _checkcollision(mctx, wctx): "check for case folding collisions in the destination context" folded = {} for fn in mctx: @@ -106,6 +106,14 @@ % (fn, folded[fold])) folded[fold] = fn + if wctx: + for fn in wctx: + fold = util.normcase(fn) + mfn = folded.get(fold, None) + if mfn and (mfn != fn): + raise util.Abort(_("case-folding collision between %s and %s") + % (mfn, fn)) + def _forgetremoved(wctx, mctx, branchmerge): """ Forget removed files @@ -549,7 +557,7 @@ if not force: _checkunknown(wc, p2, folding) if folding: - _checkcollision(p2) + _checkcollision(p2, branchmerge and p1) action += _forgetremoved(wc, p2, branchmerge) action += manifestmerge(repo, wc, p2, pa, overwrite, partial)