Case folding collision in Mercurial (WinXP)

Dan Craft DCraft at PacBell.net
Wed Jun 25 17:00:17 CDT 2008


Thanks, Matt.  I'm back in business.

Ah, I see (said the blind man to his deaf son, as my mom used to 
say--haven't thought of that in years) two things now...

>Yes. Clone -U will skip the checkout.

(1) It was the checkout which was aborting because of the case 
collision; the clone part was completing successfully.

>Here's a little trick I came up with:
>
>- make a repo with 'a' and 'A' on Linux
>- hg clone -U to Windows (actually Wine in my case)
>- cd <repo>
>- hg debugsetparents <bad revision>
>- hg debugrebuildstate
>- hg rm -A A # mark missing file as deleted
>- hg ci -m"fix case collision"
>- hg manifest tip # confirm that the collision is gone
>- hg co -C tip # get a clean checkout
>
>The trick is to use debugsetparents and debugrebuildstate to get a
>working directory that thinks its at the revision we can't check out.
>Then we record a deletion for the unwanted file. When we commit, commit
>will only record the deletion we made via hg rm.

(2) There's no need to remove the incorrectly-capitalized directory 
from beneath .hg/, which is what I was thinking would be 
tricky.  It's necessary only to stop Mercurial from tracking files 
beneath it.  Mercurial is quite happy to track multiple 
capitalizations (as some filesys require); it just mustn't be told to 
check them out to a Windows filesys.

And I certainly wouldn't have known to use the debug commands.

As for what caused this?  Operator error always seems more likely 
than cosmic rays, especially something as humanly meaningful as 
leaving a letter as lower case.  Now that I know there's a way I 
could have typed something to cause it--'hg add' typed with incorrect 
case--even though I generally use shell completion for longer 
filenames, I'll bet that was it.  One of the four files in the 
mis-capitalized directory *was* added in that changeset.

Thanks again, Matt!

--Dan


P.S.: Sorry about the thread disconnection.  Eudora won't accept an 
In-Reply-To spec as part of the mailto link, but will only generate 
it from the prior Message-ID. 



More information about the Mercurial mailing list