Resolving Mercurial Case-Folding Collision in Windows

后端 未结 9 1645
悲哀的现实
悲哀的现实 2020-12-09 08:15

I\'ve seen the other Mercurial case-folding Answers on StackOverflow - they say that if you have access to a case sensitive file system like unix then check out there and it

相关标签:
9条回答
  • 2020-12-09 08:32

    To get a case folding issue on windows I'm guessing that you've got the differing cases in different branches or heads in the repo, and it becomes a problem when merging. I can't see how (on Windows) you would actually get two different cases in the same revision without going via a unix box.

    So, if they are in different revisions then you can do something like this:

    hg update <some rev>
    hg remove -A -f "Some File"
    

    then the merge would succeed ok. The -A is for 'after', and the -f will 'force'.

    0 讨论(0)
  • 2020-12-09 08:37

    We resolved this without resorting to a case-sensitive filesystem by issuing HG rename commands. Say you are having trouble because "Foo.txt" needs to be called "foo.txt":

    hg rename Foo.txt Foo.txt.renamed
    hg rename Foo.txt.renamed foo.txt
    

    We encountered this problem when a file was deleted and then later re-created in the main repository with the same name, but different case. A branch repository that was created before these changes could not then be merged in, despite the changesets from the main repository having been pulled.

    0 讨论(0)
  • 2020-12-09 08:39

    Its a regular problem in Windows for not using case-sensitive file systems. If you want to do it with the TortoiseHg Workbench installed, search the file and rename it:

    right click/TortoiseHg/Rename File

    It will rename the file to the right case sensitive name you want. The next picture shows how i changed XMLConverter for XmlConverter

    enter image description here

    Then in the Workbench you may commit the file change:

    enter image description here

    This was updated a week later

    The solution presented may gives you problems later updating the whole repository from another PC. So the ultimate way to resolve it, may be making 2 commits:

    1. One for renaming files with the unwanted name to some temporary one. Ex.: XMLConverter2
    2. Another for renaming the temporary files to the new names. Ex.: XmlConverter

    So it got like this:

    renaming the temporary files to the new names

    This is actually the way it doesnt make conflicts in Windows anymore. It looks ugly but it is effective.

    0 讨论(0)
  • 2020-12-09 08:39

    I solved in a simpler way:

    1. List item
    2. Cut the renamed folder file and paste it on a temporary location (i.e. Desktop)
    3. Commit the "R" changes
    4. Paste the folder again
    5. Commit the "?" status

    What it's really causing the problem is trying to create and delete at the same time a file/folder that is potentially the same in case unsensitive systems.

    0 讨论(0)
  • 2020-12-09 08:42

    I know this is an old question but this is what worked for me and I hope it is of use to someone. In my case I had a legacy repo with an old branch I needed to close.

    I used to Windows bash shell of Windows 10 to resolve this lxrun /install and then when that was setup I installed mercurial sudo apt-get install mercurial This will give you access to your file system via the mnt folder, and you can use mercurial from the command line.

    In my case I could then easily update to the problematic branch and close it.

    0 讨论(0)
  • 2020-12-09 08:52

    As Laurens Holst said renaming the folder/file passing through a temporary file system worked for me.

    $ hg rename a.txt tmp
    $ hg rename tmp A.TXT
    

    But to make it work, and avoid colliding files error during merge i had to PURGE after renaming

    0 讨论(0)
提交回复
热议问题