Occasional case-folding error when trying to transplant or graft
rupert.thurner at gmail.com
Wed Feb 1 00:42:12 CST 2012
On Jan 17, 7:10 pm, Matt Mackall <m... at selenic.com> wrote:
> On Mon, 2012-01-16 at 15:46 -0800, JohnRenstrom wrote:
> > We've been using Mercurial for several years at my company and every once in
> > a while we will get that painful case-folding scenario; By using some custom
> > hooks on push we have been able to catch these problems before they get
> > pushed out to the main repository which has dramatically improved our down
> > time. Now it is just a local issue that one developer must resolve before
> > his changeset can be pushed to the server.
> > We still bump into occasional case-folding issues with transplant/graft and
> > today while I was examining one of these issues I may have stumbled onto a
> > reason why they seem to come and go so randomly.
> > *My Theory:*
> > AlthoughWindowsis a case-insensitive OS it does still preserve case; I
> > noticed today that the same file had been added to two different branches:
> > Branch 1: 'Filename.txt'
> > Branch 2: 'FILENAME.TXT' (AllUppercase)
> You probably have a tool in your toolchain that's helpfully uppercasing
> filenames on write. We've seen this with various editors.
> Mercurial itself will studiously ignore such changes for -existing-
> files. But for newly-added files, it will take the on-disk
> capitalization. After that, merges with case collisions might have
> "interesting" results onWindows.
> Recent Mercurial (as of 2.0.2 on Jan 1!) will refuse to merge branches
> if there's a case conflict and you're using a case-insensitive
> filesystem. This will probably "solve" your graft/transplant issue, but
> you'll probably need to harmonize filenames across all your branches to
> actually do any grafts.
modern windows filesystem is case sensitive like most the other
filesystems, as it stores the case of the filename. and it is
perfectly fine to do:
$ move FILE file
while mercurial gives an error on
$ hg mv FILE file
such a windows filesystem move confuses mercurial (at least v-2.0)
completely. if one changes the file and moves it, mercurial displays
the file two times:
$ hg st
besides some characters not allowed in filenames, windows only
(default) restriction compared to POSIX is to prevent creating a file
with the same name and different case. cf
More information about the Mercurial-devel