Fix Mercurial Case Folding Collisions

Posted by Dallas on December 23, 2008
Mercurial

I switched awhile ago from SVN to Mercurial and I am loving it.

One pain is if you create a file, check it in, and then later change the case (from ‘a’ to ‘A’ for example) and check that in, when you try and checkout the latest version you will get the error:

“abort: case-folding collision between myFile.m and MyFile.m”

This is one error/abort that doesn’t tell you how to fix it.

After some research I have found the following to work.

Note: Notes are in Italic. Items you should replace with your own info are in Italic and Bold.

  1. hg clone https://username@myrepo-location.com/hg/index.cgi/MyProgram
  2. cd MyProgram
  3. hg debugsetparents 11 (the revision number you need to fix)
  4. hg debugrebuildstate
  5. hg rm -A MyFile.m (mark missing file as deleted)
  6. hg ci -m “fix case collision”
  7. hg manifest tip   (confirm that the collision is gone)
  8. cd ..
  9. rm -rf MyProgram
  10. hg clone https://username@myrepo-location.com/hg/index.cgi/MyProgram

You should now have a clean clone of the repo.

Note: It is possible that after doing the above you will be presented with the same error, but on a different file (if there are multiple conflicts). If that happens just do the above again for each conflict.


Tags: ,

3 Comments to Fix Mercurial Case Folding Collisions

Jochen
January 23, 2009

Thanks Dallas, you saved me some hours.

This is a very bad behavior of Mercurial.

Note: If you need to fix an older Revision you want to update to,
push the needed Revision to an Repo and fix it there (discriped above), then clean the old one and pull the changes from the fixed Repo.

Keep it up!

Dallas
January 23, 2009

Glad it worked for you.

Frank
November 28, 2009

Thanks a bunch! Worked like a charm.

Leave a comment

WP_Big_City

ERROR: si-captcha.php plugin says GD image support not detected in PHP!

Contact your web host and ask them why GD image support is not enabled for PHP.

ERROR: si-captcha.php plugin says imagepng function not detected in PHP!

Contact your web host and ask them why imagepng function is not enabled for PHP.