Case handling on windows

Matt Mackall mpm at selenic.com
Sat Jun 28 09:42:42 CDT 2008


On Sat, 2008-06-28 at 13:53 +0400, Andrei Vermel wrote:
> Matt,
> 
> I think the way current tip handles case changes on windows is not quite
> right. At the moment it silently ignores them.
> 
> D:\distribs\mercurial\qqq>hg init
> 
> D:\distribs\mercurial\qqq>echo "aaa" >aaa.txt
> 
> D:\distribs\mercurial\qqq>hg add
> adding aaa.txt
> 
> D:\distribs\mercurial\qqq>hg ci -m 1
> 
> D:\distribs\mercurial\qqq>mv aaa.txt AAA.txt
> 
> D:\distribs\mercurial\qqq>ls
> AAA.txt
> 
> D:\distribs\mercurial\qqq>hg stat
> 
> D:\distribs\mercurial\qqq>echo "bbb" >>aaa.txt
> 
> D:\distribs\mercurial\qqq>hg stat
> M aaa.txt
> 
> I hope that this behaviour is not the intended one?

Oh, but it is. Such changes are both invisible and meaningless on
Windows, but generally fatal on Unix. Further, people and programs are
known to regularly change the case of files by accident on Windows. Why
would we want to report invisible, meaningless, and possibly accidental
changes that are fatal to other users?

If you want to change the case of a file, you simply have to tell hg
about it with hg rename.

> Also, 'add' is acting silly: 
> 
> D:\distribs\mercurial\qqq>ls
> AAA.txt
> 
> D:\distribs\mercurial\qqq>hg add aaa.txt
> aaa.txt already tracked!
>
> D:\distribs\mercurial\qqq>hg add AAA.txt
> 
> D:\distribs\mercurial\qqq>hg add Aaa.txt
> 
> D:\distribs\mercurial\qqq>hg add qqq.txt
> qqq.txt does not exist!

Yes, that is silly.

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial mailing list