case sensitive?

Matt Mackall mpm at selenic.com
Wed Jul 15 14:24:57 CDT 2009


On Wed, 2009-07-15 at 18:36 +0900, ken wrote:
> Does Mercurial 1.3 handle file names as case-sensitive on NTFS?

Yes and no. Mercurial history is always case sensitive, most operations
in the working directory are not.

> In the following commands, about.txt and ABOUT.txt seems to be treated as different files.
> 
> > hg init
> 
> > echo > about.txt
> 
> > hg commit -m a -A
> adding about.txt
> 
> > hg log ABOUT.txt   <- It does not output anything. 

Yes, this is correct behavior. Mercurial is a cross-platform system and
works in environments where ABOUT.txt and about.txt may be distinct
files. In other words, history -must- be case sensitive. The fact that
your particular copy of history is stored on Windows does not make them
the same file.

> > hg log about.txt
> changeset:   0:70cc20aec01c
> tag:         tip
> user:        kenma
> date:        Wed Jul 15 10:15:38 2009 +0900
> summary:     a
> 
> > echo aaa >> about.txt
> 
> > hg commit -m aaa ABOUT.txt    <- It's ignored
> abort: ABOUT.txt: file not tracked!

That could be better. You'll find that this works everywhere else in the
working directory (eg status, diff, etc.), but commit's a bit pickier
about committing exact file names.

-- 
http://selenic.com : development and support for Mercurial and Linux




More information about the Mercurial mailing list