diff -r 70b5e25f1598 -r cbf2ea2f5ca1 mercurial/merge.py --- a/mercurial/merge.py Fri Apr 20 11:08:14 2012 -0500 +++ b/mercurial/merge.py Mon Apr 16 01:11:29 2012 +0900 @@ -110,10 +110,18 @@ folded[fold] = fn if wctx: + # class to delay looking up copy mapping + class pathcopies(object): + @util.propertycache + def map(self): + # {dst@mctx: src@wctx} copy mapping + return copies.pathcopies(wctx, mctx) + pc = pathcopies() + for fn in wctx: fold = util.normcase(fn) mfn = folded.get(fold, None) - if mfn and (mfn != fn): + if mfn and mfn != fn and pc.map.get(mfn) != fn: raise util.Abort(_("case-folding collision between %s and %s") % (mfn, fn)) @@ -568,7 +576,11 @@ action = [] folding = not util.checkcase(repo.path) if folding: - _checkcollision(p2, branchmerge and p1) + # collision check is not needed for clean update + if not branchmerge and force: + _checkcollision(p2, None) + else: + _checkcollision(p2, wc) if not force: _checkunknown(repo, wc, p2) action += _forgetremoved(wc, p2, branchmerge)