| 1 |
#require icasefs |
| 2 |
|
| 3 |
$ hg debugfs | grep 'case-sensitive:' |
| 4 |
case-sensitive: no |
| 5 |
|
| 6 |
test file addition with bad case |
| 7 |
|
| 8 |
$ hg init repo1 |
| 9 |
$ cd repo1 |
| 10 |
$ echo a > a |
| 11 |
$ hg add A |
| 12 |
$ hg st |
| 13 |
A a |
| 14 |
$ hg ci -m adda |
| 15 |
$ hg manifest |
| 16 |
a |
| 17 |
$ cd .. |
| 18 |
|
| 19 |
test case collision on rename (issue750) |
| 20 |
|
| 21 |
$ hg init repo2 |
| 22 |
$ cd repo2 |
| 23 |
$ echo a > a |
| 24 |
$ hg --debug ci -Am adda |
| 25 |
adding a |
| 26 |
committing files: |
| 27 |
a |
| 28 |
committing manifest |
| 29 |
committing changelog |
| 30 |
updating the branch cache |
| 31 |
committed changeset 0:07f4944404050f47db2e5c5071e0e84e7a27bba9 |
| 32 |
|
| 33 |
Case-changing renames should work: |
| 34 |
|
| 35 |
$ hg mv a A |
| 36 |
$ hg mv A a |
| 37 |
$ hg st |
| 38 |
|
| 39 |
addremove after case-changing rename has no effect (issue4590) |
| 40 |
|
| 41 |
$ hg mv a A |
| 42 |
$ hg addremove |
| 43 |
recording removal of a as rename to A (100% similar) |
| 44 |
$ hg revert --all |
| 45 |
forgetting A |
| 46 |
undeleting a |
| 47 |
|
| 48 |
test changing case of path components |
| 49 |
|
| 50 |
$ mkdir D |
| 51 |
$ echo b > D/b |
| 52 |
$ hg ci -Am addb D/b |
| 53 |
$ hg mv D/b d/b |
| 54 |
D/b: not overwriting - file already committed |
| 55 |
('hg rename --force' to replace the file by recording a rename) |
| 56 |
[1] |
| 57 |
$ hg mv D/b d/c |
| 58 |
$ hg st |
| 59 |
A D/c |
| 60 |
R D/b |
| 61 |
$ mv D temp |
| 62 |
$ mv temp d |
| 63 |
$ hg st |
| 64 |
A D/c |
| 65 |
R D/b |
| 66 |
$ hg revert -aq |
| 67 |
$ rm d/c |
| 68 |
$ echo c > D/c |
| 69 |
$ hg add D/c |
| 70 |
$ hg st |
| 71 |
A D/c |
| 72 |
$ hg ci -m addc D/c |
| 73 |
$ hg mv d/b d/e |
| 74 |
$ hg st |
| 75 |
A D/e |
| 76 |
R D/b |
| 77 |
$ hg revert -aq |
| 78 |
$ rm d/e |
| 79 |
$ hg mv d/b D/B |
| 80 |
$ hg st |
| 81 |
A D/B |
| 82 |
R D/b |
| 83 |
$ cd .. |
| 84 |
|
| 85 |
test case collision between revisions (issue912) |
| 86 |
|
| 87 |
$ hg init repo3 |
| 88 |
$ cd repo3 |
| 89 |
$ echo a > a |
| 90 |
$ hg ci -Am adda |
| 91 |
adding a |
| 92 |
$ hg rm a |
| 93 |
$ hg ci -Am removea |
| 94 |
$ echo A > A |
| 95 |
|
| 96 |
on linux hfs keeps the old case stored, force it |
| 97 |
|
| 98 |
$ mv a aa |
| 99 |
$ mv aa A |
| 100 |
$ hg ci -Am addA |
| 101 |
adding A |
| 102 |
|
| 103 |
used to fail under case insensitive fs |
| 104 |
|
| 105 |
$ hg up -C 0 |
| 106 |
1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
| 107 |
$ hg up -C |
| 108 |
1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
| 109 |
|
| 110 |
no clobbering of untracked files with wrong casing |
| 111 |
|
| 112 |
$ hg up -r null |
| 113 |
0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
| 114 |
$ echo gold > a |
| 115 |
$ hg up |
| 116 |
A: untracked file differs |
| 117 |
abort: untracked files in working directory differ from files in requested revision |
| 118 |
[20] |
| 119 |
$ cat a |
| 120 |
gold |
| 121 |
$ rm a |
| 122 |
|
| 123 |
test that normal file in different case on target context is not |
| 124 |
unlinked by largefiles extension. |
| 125 |
|
| 126 |
$ cat >> .hg/hgrc <<EOF |
| 127 |
> [extensions] |
| 128 |
> largefiles= |
| 129 |
> EOF |
| 130 |
$ hg update -q -C 1 |
| 131 |
$ hg status -A |
| 132 |
$ echo 'A as largefiles' > A |
| 133 |
$ hg add --large A |
| 134 |
$ hg commit -m '#3' |
| 135 |
created new head |
| 136 |
$ hg manifest -r 3 |
| 137 |
.hglf/A |
| 138 |
$ hg manifest -r 0 |
| 139 |
a |
| 140 |
$ hg update -q -C 0 |
| 141 |
$ hg status -A |
| 142 |
C a |
| 143 |
$ hg update -q -C 3 |
| 144 |
$ hg update -q 0 |
| 145 |
|
| 146 |
$ hg up -C -r 2 |
| 147 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 148 |
$ hg mv A a |
| 149 |
$ hg diff -g > rename.diff |
| 150 |
$ hg ci -m 'A -> a' |
| 151 |
$ hg up -q '.^' |
| 152 |
$ hg import rename.diff -m "import rename A -> a" |
| 153 |
applying rename.diff |
| 154 |
$ hg st |
| 155 |
? rename.diff |
| 156 |
$ hg files |
| 157 |
a |
| 158 |
$ find * | sort |
| 159 |
a |
| 160 |
rename.diff |
| 161 |
|
| 162 |
$ rm rename.diff |
| 163 |
|
| 164 |
$ cd .. |
| 165 |
|
| 166 |
issue 3342: file in nested directory causes unexpected abort |
| 167 |
|
| 168 |
$ hg init issue3342 |
| 169 |
$ cd issue3342 |
| 170 |
|
| 171 |
$ mkdir -p a/B/c/D |
| 172 |
$ echo e > a/B/c/D/e |
| 173 |
$ hg add a/B/c/D/e |
| 174 |
$ hg ci -m 'add e' |
| 175 |
|
| 176 |
issue 4481: revert across case only renames |
| 177 |
$ hg mv a/B/c/D/e a/B/c/d/E |
| 178 |
$ hg ci -m "uppercase E" |
| 179 |
$ echo 'foo' > a/B/c/D/E |
| 180 |
$ hg ci -m 'e content change' |
| 181 |
$ hg revert --all -r 0 |
| 182 |
removing a/B/c/D/E |
| 183 |
adding a/B/c/D/e |
| 184 |
$ find * | sort |
| 185 |
a |
| 186 |
a/B |
| 187 |
a/B/c |
| 188 |
a/B/c/D |
| 189 |
a/B/c/D/e |
| 190 |
a/B/c/D/e.orig |
| 191 |
|
| 192 |
$ cd .. |
| 193 |
|
| 194 |
issue 3340: mq does not handle case changes correctly |
| 195 |
|
| 196 |
in addition to reported case, 'hg qrefresh' is also tested against |
| 197 |
case changes. |
| 198 |
|
| 199 |
$ echo "[extensions]" >> $HGRCPATH |
| 200 |
$ echo "mq=" >> $HGRCPATH |
| 201 |
|
| 202 |
$ hg init issue3340 |
| 203 |
$ cd issue3340 |
| 204 |
|
| 205 |
$ echo a > mIxEdCaSe |
| 206 |
$ hg add mIxEdCaSe |
| 207 |
$ hg commit -m '#0' |
| 208 |
$ hg rename mIxEdCaSe tmp |
| 209 |
$ hg rename tmp MiXeDcAsE |
| 210 |
$ hg status -A |
| 211 |
A MiXeDcAsE |
| 212 |
mIxEdCaSe |
| 213 |
R mIxEdCaSe |
| 214 |
$ hg qnew changecase |
| 215 |
$ hg status -A |
| 216 |
C MiXeDcAsE |
| 217 |
|
| 218 |
$ hg qpop -a |
| 219 |
popping changecase |
| 220 |
patch queue now empty |
| 221 |
$ hg qnew refresh-casechange |
| 222 |
$ hg status -A |
| 223 |
C mIxEdCaSe |
| 224 |
$ hg rename mIxEdCaSe tmp |
| 225 |
$ hg rename tmp MiXeDcAsE |
| 226 |
$ hg status -A |
| 227 |
A MiXeDcAsE |
| 228 |
mIxEdCaSe |
| 229 |
R mIxEdCaSe |
| 230 |
$ hg qrefresh |
| 231 |
$ hg status -A |
| 232 |
C MiXeDcAsE |
| 233 |
|
| 234 |
$ hg qpop -a |
| 235 |
popping refresh-casechange |
| 236 |
patch queue now empty |
| 237 |
$ hg qnew refresh-pattern |
| 238 |
$ hg status |
| 239 |
$ echo A > A |
| 240 |
$ hg add |
| 241 |
adding A |
| 242 |
$ hg qrefresh a # issue 3271, qrefresh with file handled case wrong |
| 243 |
$ hg status # empty status means the qrefresh worked |
| 244 |
|
| 245 |
#if osx |
| 246 |
|
| 247 |
We assume anyone running the tests on a case-insensitive volume on OS |
| 248 |
X will be using HFS+. If that's not true, this test will fail. |
| 249 |
|
| 250 |
$ rm A |
| 251 |
>>> open(u'a\u200c'.encode('utf-8'), 'w').write('unicode is fun') and None |
| 252 |
$ hg status |
| 253 |
M A |
| 254 |
|
| 255 |
#endif |
| 256 |
|
| 257 |
$ cd .. |