Mercurial “case-folding collision”

We ran into a problem recently that had to do with renaming a file in our code base.  Essentially, we wanted to rename a file from “adhocThing.txt” to “adHocThing.txt”.

The problem is that we develop on Windows and our source code repository is hosted on Linux.  Linux is case sensitive.  Windows ain’t.

After some google fu I found a page that described how to fix the problem:

http://mercurial.selenic.com/wiki/FixingCaseCollisions

The simplest fix is to clone the code to a case sensitive OS machine and remove the unwanted file there and recommit and push.  The important thing to note is that when the code is on the machine with the case sensitive OS there are actually two files present:  “adhocThing.txt” and “adHocThing.txt”.  No problem.  Those two files can live happily side by side in a Linux environment.

The problem appears when you try to pull those two files to your Windows machine.  Hg can’t tell the difference between the two files on Windows, so it causes an “abort: case-folding collision”.

I guess, what I’m trying to get across with this post is an explanation of what “case-folding collision” means.  Hopefully, I’ve succeeded.  🙂

 

It's only fair to share...
Share on FacebookGoogle+Tweet about this on TwitterShare on LinkedIn

Leave a Reply