[issue3258] Mercurial allows windows-only case-folding collision to occur

David Sedlock bugs at mercurial.selenic.com
Fri Feb 10 08:21:48 UTC 2012


New submission from David Sedlock <David.Sedlock at lantiq.com>:

Relying on Mercurial - The Definitive Guide, one would think that a
case-folding collision can only result from a repo being used in windows and
in a case-sensitive OS such as Linux
(http://hgbook.red-bean.com/read/file-names-and-pattern-matching.html#sec:names:case).

In fact, a case-folding collision can be created completely in Windows (win7
here):

$ hg version
Mercurial Distributed SCM (version 2.0-lantiq)
C:\tmp\win_case_folding>hg init
C:\tmp\win_case_folding>echo>file.txt
C:\tmp\win_case_folding>hg commit -A -m file.txt
adding file.txt
C:\tmp\win_case_folding>hg up null
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
C:\tmp\win_case_folding>echo>File.txt
C:\tmp\win_case_folding>hg commit -A -m File.txt
adding File.txt
created new head
C:\tmp\win_case_folding>hg merge
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
C:\tmp\win_case_folding>hg commit -A -m merge
C:\tmp\win_case_folding>hg up 1
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
C:\tmp\win_case_folding>hg up tip
abort: case-folding collision between file.txt and File.txt

Surely, the merge should fail here - or at latest the commit.

It's understandable that in the case of mixed platform usage Mercurial
cannot protect the user against this. But when the conflict is created
purely in windows, the user should be protected against himself. (Note that
this could easily occur with two users. In fact, my team had to sort out a
real case recently.)

----------
messages: 19030
nosy: sedlock
priority: bug
status: unread
title: Mercurial allows windows-only case-folding collision to occur

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue3258>
____________________________________________________



More information about the Mercurial-devel mailing list