tests/test-casecollision.t
author Kevin Gessner <kevin@kevingessner.com>
Sat, 30 Apr 2011 12:39:46 +0200
changeset 14068 04ce8fa1015d
child 14178 524c560e2d32
permissions -rw-r--r--
add: notify 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 or error is now given for such collisions, depending on the value of ui.portablefilenames ('warn', 'abort', or 'ignore'): $ touch file File $ hg add --config ui.portablefilenames=abort File abort: possible case-folding collision for File $ hg add File warning: possible case-folding collision for File
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14068
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
     1
run only on case-sensitive filesystems
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
     2
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
     3
  $ "$TESTDIR/hghave" no-icasefs || exit 80
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
     4
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
     5
test file addition with colliding case
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
     6
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
     7
  $ hg init repo1
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
     8
  $ cd repo1
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
     9
  $ echo a > a
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
    10
  $ echo A > A
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
    11
  $ hg add a
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
    12
  $ hg st
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
    13
  A a
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
    14
  ? A
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
    15
  $ hg add --config ui.portablefilenames=abort A
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
    16
  abort: possible case-folding collision for A
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
    17
  [255]
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
    18
  $ hg st
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
    19
  A a
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
    20
  ? A
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
    21
  $ hg add A
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
    22
  warning: possible case-folding collision for A
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
    23
  $ hg st
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
    24
  A A
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
    25
  A a
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
    26
  $ hg forget A
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
    27
  $ hg st
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
    28
  A a
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
    29
  ? A
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
    30
  $ hg add --config ui.portablefilenames=no A
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
    31
  $ hg st
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
    32
  A A
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
    33
  A a
04ce8fa1015d add: notify when adding a file that would cause a case-folding collision
Kevin Gessner <kevin@kevingessner.com>
parents:
diff changeset
    34
  $ cd ..