Occasional case-folding error when trying to transplant or graft

rupert.thurner rupert.thurner at gmail.com
Thu Feb 2 04:39:38 CST 2012


On Feb 1, 7:04 pm, Matt Mackall <m... at selenic.com> wrote:
> On Tue, 2012-01-31 at 22:42 -0800,rupert.thurner wrote:
> > 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.
> > modernwindowsfilesystem is case sensitive like most the other
> > filesystems, as it stores the case of the filename. and it is
> > perfectly fine to do:
>
> Basically everyone (including Microsoft, in your cite) refers to that
> behavior as "case-insensitive".
>
> > $ move FILE file
> > while mercurial gives an error on
> > $ hg mv FILE file
>
> Known issue with trivial workaround.
>
> > such awindowsfilesystem 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
> > M FILE
> > ? file
>
> Works for me. Please file a bug with a test case if it's still present
> in 2.0.2 or 2.1.

i tested it on windows7 and hg-2.1, and indeed the output is
different:
 $ hg st
 M FILE

now i am wondering what i need to do to lowercase the file in the
repository, as we develop mostly on windows, and run the software on
unix.

rupert.


More information about the Mercurial-devel mailing list