[PATCH 1 of 1] add: warn when adding a file that would cause a case-folding collision

Martin Geisler mg at lazybytes.net
Sat Apr 30 04:59:00 CDT 2011


Kevin Gessner <kevin at fogcreek.com> writes:

> On Sat, Apr 30, 2011 at 11:50 AM, Martin Geisler <mg at lazybytes.net> wrote:
>> Kevin Gessner <kevin at fogcreek.com> writes:
>>
>>> # HG changeset patch
>>> # User Kevin Gessner <kevin at kevingessner.com>
>>> # Date 1304154504 -7200
>>> # Node ID 4421446fa1a4cae3fbb54642d8004a9615ea565a
>>> # Parent  92db9667d15ae7b5caf1a9653c2d45b5fdaf0e67
>>> add: warn when adding a file that would cause a case-folding collision
>>>
>>> On a case-sensitive file system, files can be added with names that
>>> differ only in case (a "case collision"). This would cause an error on
>>> case-insensitive filesystems. A warning is now given for such
>>> collisions:
>>>
>>>     $ touch file File
>>>     $ hg add file
>>>     $ hg add File
>>>     warning: possible case-folding collision for File
>>
>> Nice -- that should go into a test case :)
>
> The test case will only work on systems with a case-sensitive FS; I
> guess I'd have to protect it with hghave icasefs. Feasible.

That would be great.

>> Also, I was initially thinking that this would be combined with the new
>> ui.portablefilenames setting that is checked in scmutil.checkportable.
>>
>> But that function does not know about the currently checked in files so
>> maybe that is a bad idea?
>
> Please see my patch v2, 2 of 2, from a couple minutes ago.

Yeah, I just noticed it! :)

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://aragost.com/mercurial/


More information about the Mercurial-devel mailing list