TortoiseHg 1.1.4 trouble to rename a directory with only different case

Steve Borho steve at borho.org
Mon Nov 1 14:51:17 UTC 2010


On Mon, Nov 1, 2010 at 5:54 AM, Valborg Kalender <valborg00 at yahoo.com> wrote:
> TortoiseHg 1.1.4 trouble to rename a directory with only different case
>
> Hi there,
>
> When trying to rename a directory using TortoiseHg on a Windows (I'm
> using Windows 7) where only change is the directory name case, the
> result is a corrupt archive.
>
> The example below is shown using as much as possible using mercurial
> from the CMD command prompt. This just to make it more ilustrative.
>
> 1) Create a directory with a look like below:
>
>    C:\Temp\Test\Dir1
>    C:\Temp\Test\Dir1\File1.txt
>    C:\Temp\Test\Dir1\File2.txt
>    C:\Temp\Test\Dir2
>    C:\Temp\Test\Dir2\File3.txt
>
> 2) Create the archive:
>
>    C:\Temp\Test> hg init
>    C:\Temp\Test> hg add
>    C:\Temp\Test> hg commit -m "First version"
>
> 3) Try to rename the directory "Dir1" to "dir1".
>
>    NOTE: I rename the directory twice, just so that I don't get a
>          directory "C:\Temp\Test\dir1\Dir1". I guess you can do this
>          in one run...
>
>    C:\Temp\Test> hg rename Dir1 Dir1X
>    C:\Temp\Test> hg rename Dir1X dir1
>
> 4) Show archive status:
>
>    C:\Temp\Test> hg status
>
>      A dir1\File1.txt
>      A dir1\File2.txt
>      R Dir1\File1.txt
>      R Dir1\File2.txt
>
> 5a) Save the changes in the archive using TortoiseHg from the context
>     menu in Windows Explorer (ie. TORTOISEHG -> COMMIT).
>
> 5b) After the commit is made, there is a leftover.
>
>     C:\Temp\Test> hg status
>
>      A dir1\File2.txt
>      R Dir1\File2.txt

This was a regression bug in Mercurial itself around version 1.3.   We
hope to have a fix for this in 1.7.

> 5c) The archive now seems to be in a "flux" state.
>
>     C:\Temp\Test> hg clone C:\Temp\Test C:\Temp\TestClone
>
>     updating to branch default
>     abort: case-folding collision between dir1/File1.txt and Dir1/File1.txt
>
> 5d) In this situation you HAVE TO make one extra commit from the command-
>     line. There is no way to make an extra commit using TortoiseHg (nothing
>     is commited how many times you try).
>
>     C:\Temp\Test> hg commit -m "Make commit of missing files"
>
> 6a) If you instead do the commit from the command-line (instead of point
> (5a)
>     above) everything workes as expected.
>
>     C:\Temp\Test> hg commit -m "Change of directory name"
>
> I don't know if this is a decided design time behaviour in TortoiseHg, or if
> its a flaw. In case it is a flaw maybe an adjustment can be incorporated in
> a future version.


-- 
Steve Borho



More information about the Mercurial mailing list