[PATCH 5 of 8] Fix for issue 750 (Revisions with case-only renames ...)

Paul Moore p.f.moore at gmail.com
Thu May 1 15:30:37 CDT 2008


2008/5/1 Matt Mackall <mpm at selenic.com>:
>  > Fix for issue 750 (Revisions with case-only renames ...)
>  >
>  > This patch ensures that case-only renames are merged correctly by sorting the
>  > merge actions case insensitively on filename, and then making sure removes
>  > sort before fetches (so that the remove of the old case does not remove the
>  > newly-fetched new case).
>
>  Is this actually still necessary? The new merge code stashes a copy of
>  every file to be merged before anything else happens so that file merges
>  can be retried.

It seems to be, to me - at least the bug is still present in crew, and
as far as I can tell, it's because, given a file a.txt and a rename
a.txt -> A.TXT, the code does a get of A.TXT first, then the remove of
a.txt. And on a case-insensitive system, that second step, the remove,
quite happily removes the A.TXT that you've just retrieved. The cause,
fundamentally, is that os.remove('a.txt') will remove A.TXT, and you
can't stop it doing so, so you have to avoid giving it the chance.

On the other hand, I'm not 100% sure what you mean by "the new merge
code" - I've been looking solely at crew, is that what you're
referring to, or is there even newer code I haven't seen?

Paul.


More information about the Mercurial-devel mailing list