Adam Ramadhan
Adam Ramadhan

Reputation: 22810

Mercurial HG case-folding collision?

  1. first i have a file name readme
  2. then i change it to README
  3. commit
  4. push

ok the problem is there are two files: readme and README

how do i delete the readme on the repository ?

when i do update i get this error abort: case-folding collision between readme and README

Upvotes: 12

Views: 9619

Answers (5)

Zarepheth
Zarepheth

Reputation: 2583

I had this issue where the case-collision was happening when I performed an Update to a particular revision. The revision in question was a committed performed specifically to address a case-folding collision where I renamed the file. Unfortunately, Mercurial was not going to allow me to Update to the revision.

However, I could still Update to revisions before and after it. So if you are encountering this problem on Windows (or a similar case-insensitive file system) while simply Updateing to a particular revision, you may be able to bypass the problem revision by Updateing to one before or after it.

Upvotes: 0

Chris Marisic
Chris Marisic

Reputation: 33098

Supposing you want readme to be README.

hg mv readme foofile
hg mv foofile README

Do this and commit these changes and the repo should be usable again.

Upvotes: 1

user2324323
user2324323

Reputation: 79

If It was a rename,thats like abc.txt moved to Abc.txt

Will the following work?

Take a patch, Check out the code fresh, Apply the patch on top of it. then commit n push

Upvotes: -1

Chip McCormick
Chip McCormick

Reputation: 744

This question is a duplicate of and could be folded into Resolving Mercurial Case-Folding Collision in Windows

I agree with the comment there that asking someone to work within a case sensitive file system is a little heavyhanded, even with Cygwin. The cleanest solution assuming two files and seems to be:

  1. hg revert to head of the branch to be merged that has
  2. hg remove // then commit, etc.
  3. check the file history on . It's possible that some additions were incorrectly made to the renamed file
  4. If so, manually add those changes to

Upvotes: 1

Ry4an Brase
Ry4an Brase

Reputation: 78330

Mercurial can handle filenames in the same directory that differ only in their case within its repositories (.hg directory at the top level of your repo). On case sensitive file systems (most on unix) it can handle those files in the working directory too. However, on systems that are merely case-retentive the OS doesn't let you have two files in the same directory that differ only by case and Mercurial warns you about that (as you've seen).

To work around this limitation of your OS, checkout your clone on a case sensitive file system, delete the file, and then commit/push. So long as the windows people aren't hg updating to a revision that has the collision they'll be okay (since it's okay down in the repository just not in their working dir).

Upvotes: 15

Related Questions