Search code examples
svnversion-controlmercurialtortoisehg

Mercurial Case folding issue


This is not a unique problem that has not been there in the past, but none of the solutions have helped me yet.

My Case - A huge repository that was maintained by Perforce(by my company's central SCM) team. Now they change something, and all individual teams manage their own SCM and use the main perforce only for regular updates(Don't ask me why - i have no say in this)

however my problem - we moved to Mercurial for our team's projects.

Its huge - about 300k files and cross platform compilable.

The mercurial repo that i set up works well with Linux, but on windows i get the case folding error and not able to checkout or clone repos.

I tried the solutions from https://www.mercurial-scm.org/wiki/CaseFolding

and the result looks like this

  1. hgfold extension - does not work - it throws some unknown python exception and someone faced this issue and the maintainer of the extension is aware of it but has no immediate fix.

  2. It is not possible to simply rename the files, our repo will break, i have to live with the same file name, and in linux it works great and are being used. So i don't know if renaming is an option.

  3. Perforce handles it well, but as i said i have no say here.

So is there any other way out here?? Can SVN handle casefoldings well?? Any help is of very use to me.


Solution

  • There is a chapter in the Mercurial book chapter Case sensitivity

    Just find a nearby Linux or Unix box, clone the problem repository onto it, and use Mercurial's hg rename command to change the names of any offending files or directories so that they will no longer cause case folding conflicts. Commit this change, hg pull or hg push it across to your Windows or MacOS system, and hg update to the revision with the non-conflicting names.

    The problem is that there is not really a working automated way to resolve cases clashes. Filenames are often referenced in other files like Makefiles or include statements or config file reads in source. So any way to resolve this automatically is prone to break something.

    From the comments on the above chapters a few tips:

    Grant Baillie 2009-08-13 On a Mac, you can also do this repair on your computer by creating a disk image containing a case-sensitive filesystem. Launch Disk Utility (in /Applications/Utilities), click File -> New -> Blank Disk Image ..., and choose "Mac OS Extended (Journaled, Case-sensitive)" as the Volume Format.

    and you could use

    find . -print | sort -f | uniq -di 
    

    on a case sensitive filesystem to find all filenames that clash on case.