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

Kevin Gessner kevin at fogcreek.com
Sat Apr 30 05:54:31 CDT 2011


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.

> 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.


More information about the Mercurial-devel mailing list