Mercurial > public > mercurial-scm > hg-stable
diff mercurial/merge.py @ 15673:d550168f11ce stable
merge: check filename case collision between changesets for branch merging
this patch makes branch merging abort when merged changesets have same
file in different case on case insensitive filesystem.
this patch does not prevent linear update which merges between target
and working contexts, because 'branchmerge' is False in such case.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Fri, 16 Dec 2011 21:21:27 +0900 |
parents | 7f01ad702405 |
children | 7b7f03502b5a |
line wrap: on
line diff
--- 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)