tests/test-casefolding.t
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Sat, 31 Mar 2012 00:04:08 +0900
branchstable
changeset 16313 e785456f9631
parent 16288 09f2bb3a37b5
child 16318 73f4e05287b4
child 16323 0789d1bbf6c1
permissions -rw-r--r--
dirstate: avoid normalizing letter case on icasefs for exact match (issue3340) on icasefs, "hg qnew" fails to import changing letter case of filename already occurred in working directory, for example: $ hg rename a tmp $ hg rename tmp A $ hg qnew casechange $ hg status R a $ "hg qnew" invokes 'dirstate.walk()' via 'localrepository.commit()' with 'exact match' matching object having exact filenames of targets in ones 'files()'. current implementation of 'dirstate.walk()' always normalizes letter case of filenames from 'match.files()' on icasefs, even though exact matching is required. then, files only different in letter case are treated as one file. this patch prevents 'dirstate.walk()' from normalizing, if exact matching is required, even on icasefs. filenames for 'exact matching' are given not from user command line, but from dirstate walk result, manifest of changecontext, patch files or fixed list for specific system files (e.g.: '.hgtags'). in such case, case normalization should not be done, so this patch works well.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12603
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
     1
  $ "$TESTDIR/hghave" icasefs || exit 80
6806
2134d6c09432 Add test for case folding issues
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     2
15538
b0a88bda3381 update: don't clobber untracked files with wrong casing
Mads Kiilerich <mads@kiilerich.com>
parents: 12603
diff changeset
     3
  $ hg debugfs | grep 'case-sensitive:'
b0a88bda3381 update: don't clobber untracked files with wrong casing
Mads Kiilerich <mads@kiilerich.com>
parents: 12603
diff changeset
     4
  case-sensitive: no
b0a88bda3381 update: don't clobber untracked files with wrong casing
Mads Kiilerich <mads@kiilerich.com>
parents: 12603
diff changeset
     5
12603
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
     6
test file addition with bad case
6806
2134d6c09432 Add test for case folding issues
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     7
12603
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
     8
  $ hg init repo1
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
     9
  $ cd repo1
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    10
  $ echo a > a
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    11
  $ hg add A
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    12
  adding a
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    13
  $ hg st
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    14
  A a
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    15
  $ hg ci -m adda
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    16
  $ hg manifest
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    17
  a
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    18
  $ cd ..
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    19
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    20
test case collision on rename (issue750)
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    21
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    22
  $ hg init repo2
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    23
  $ cd repo2
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    24
  $ echo a > a
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    25
  $ hg --debug ci -Am adda
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    26
  adding a
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    27
  a
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    28
  committed changeset 0:07f4944404050f47db2e5c5071e0e84e7a27bba9
16288
09f2bb3a37b5 tests: remove case-folding false positive
Matt Mackall <mpm@selenic.com>
parents: 15894
diff changeset
    29
09f2bb3a37b5 tests: remove case-folding false positive
Matt Mackall <mpm@selenic.com>
parents: 15894
diff changeset
    30
Case-changing renames should work:
12603
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    31
16288
09f2bb3a37b5 tests: remove case-folding false positive
Matt Mackall <mpm@selenic.com>
parents: 15894
diff changeset
    32
  $ hg mv a A
09f2bb3a37b5 tests: remove case-folding false positive
Matt Mackall <mpm@selenic.com>
parents: 15894
diff changeset
    33
  $ hg mv A a
12603
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    34
  $ hg st
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    35
  $ cd ..
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    36
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    37
test case collision between revisions (issue912)
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    38
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    39
  $ hg init repo3
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    40
  $ cd repo3
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    41
  $ echo a > a
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    42
  $ hg ci -Am adda
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    43
  adding a
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    44
  $ hg rm a
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    45
  $ hg ci -Am removea
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    46
  $ echo A > A
6806
2134d6c09432 Add test for case folding issues
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    47
12603
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    48
on linux hfs keeps the old case stored, force it
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    49
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    50
  $ mv a aa
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    51
  $ mv aa A
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    52
  $ hg ci -Am addA
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    53
  adding A
6806
2134d6c09432 Add test for case folding issues
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    54
12603
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    55
used to fail under case insensitive fs
6806
2134d6c09432 Add test for case folding issues
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    56
12603
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    57
  $ hg up -C 0
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    58
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    59
  $ hg up -C
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    60
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
15538
b0a88bda3381 update: don't clobber untracked files with wrong casing
Mads Kiilerich <mads@kiilerich.com>
parents: 12603
diff changeset
    61
b0a88bda3381 update: don't clobber untracked files with wrong casing
Mads Kiilerich <mads@kiilerich.com>
parents: 12603
diff changeset
    62
no clobbering of untracked files with wrong casing
b0a88bda3381 update: don't clobber untracked files with wrong casing
Mads Kiilerich <mads@kiilerich.com>
parents: 12603
diff changeset
    63
b0a88bda3381 update: don't clobber untracked files with wrong casing
Mads Kiilerich <mads@kiilerich.com>
parents: 12603
diff changeset
    64
  $ hg up -r null
b0a88bda3381 update: don't clobber untracked files with wrong casing
Mads Kiilerich <mads@kiilerich.com>
parents: 12603
diff changeset
    65
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
b0a88bda3381 update: don't clobber untracked files with wrong casing
Mads Kiilerich <mads@kiilerich.com>
parents: 12603
diff changeset
    66
  $ echo gold > a
b0a88bda3381 update: don't clobber untracked files with wrong casing
Mads Kiilerich <mads@kiilerich.com>
parents: 12603
diff changeset
    67
  $ hg up
15894
44fa047cef57 merge: report all files in _checkunknown
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15538
diff changeset
    68
  a: untracked file differs
44fa047cef57 merge: report all files in _checkunknown
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15538
diff changeset
    69
  abort: untracked files in working directory differ from files in requested revision
15538
b0a88bda3381 update: don't clobber untracked files with wrong casing
Mads Kiilerich <mads@kiilerich.com>
parents: 12603
diff changeset
    70
  [255]
b0a88bda3381 update: don't clobber untracked files with wrong casing
Mads Kiilerich <mads@kiilerich.com>
parents: 12603
diff changeset
    71
  $ cat a
b0a88bda3381 update: don't clobber untracked files with wrong casing
Mads Kiilerich <mads@kiilerich.com>
parents: 12603
diff changeset
    72
  gold
b0a88bda3381 update: don't clobber untracked files with wrong casing
Mads Kiilerich <mads@kiilerich.com>
parents: 12603
diff changeset
    73
12603
f1646efc54a6 tests: unify test-casefolding
Brodie Rao <brodie@bitheap.org>
parents: 9396
diff changeset
    74
  $ cd ..
16313
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
    75
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
    76
issue 3340: mq does not handle case changes correctly
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
    77
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
    78
in addition to reported case, 'hg qrefresh' is also tested against
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
    79
case changes.
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
    80
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
    81
  $ echo "[extensions]" >> $HGRCPATH
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
    82
  $ echo "mq=" >> $HGRCPATH
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
    83
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
    84
  $ hg init issue3340
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
    85
  $ cd issue3340
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
    86
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
    87
  $ echo a > mIxEdCaSe
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
    88
  $ hg add mIxEdCaSe
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
    89
  $ hg commit -m '#0'
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
    90
  $ hg rename mIxEdCaSe tmp
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
    91
  $ hg rename tmp MiXeDcAsE
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
    92
  $ hg status -A
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
    93
  A MiXeDcAsE
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
    94
    mIxEdCaSe
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
    95
  R mIxEdCaSe
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
    96
  $ hg qnew changecase
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
    97
  $ hg status -A
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
    98
  C MiXeDcAsE
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
    99
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
   100
  $ hg qpop -a
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
   101
  popping changecase
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
   102
  patch queue now empty
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
   103
  $ hg qnew refresh-casechange
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
   104
  $ hg status -A
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
   105
  C mIxEdCaSe
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
   106
  $ hg rename mIxEdCaSe tmp
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
   107
  $ hg rename tmp MiXeDcAsE
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
   108
  $ hg status -A
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
   109
  A MiXeDcAsE
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
   110
    mIxEdCaSe
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
   111
  R mIxEdCaSe
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
   112
  $ hg qrefresh
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
   113
  $ hg status -A
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
   114
  C MiXeDcAsE
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
   115
e785456f9631 dirstate: avoid normalizing letter case on icasefs for exact match (issue3340)
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 16288
diff changeset
   116
  $ cd ..