[PATCH 4 of 6 STABLE V3] merge: check filename case collision between merged changesets

Matt Mackall mpm at selenic.com
Tue Dec 13 14:07:16 CST 2011


On Mon, 2011-12-12 at 22:25 +0900, FUJIWARA Katsunori wrote:
> # HG changeset patch
> # User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
> # Date 1323677419 -32400
> # Branch stable
> # Node ID 34aba3511c68823a927bf5957f813ae0d3dd4214
> # Parent  d7229f60ad8aacd657d780935235a84048413dc6
> merge: check filename case collision between merged changesets
> 
> this patch makes merge abort when merged changesets have same file in
> different case on case insensitive filesystem.
> 
> diff -r d7229f60ad8a -r 34aba3511c68 mercurial/merge.py
> --- a/mercurial/merge.py	Mon Dec 12 17:10:19 2011 +0900
> +++ b/mercurial/merge.py	Mon Dec 12 17:10:19 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,13 @@
>                               % (fn, folded[fold]))
>          folded[fold] = fn
> +    for fn in (wctx or []):

"if wctx:", please

> +            _checkcollision(p2, branchmerge and p1)

What happens on linear updates? Is it correct?

If Alice moves 'a' to 'A' and then Bob pulls and updates while he has
edits to 'a', will he now have a modified 'A'?

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list