##// END OF EJS Templates
test-remove: drop a useless Windows specific conditional...
Matt Harbison -
r28889:7a1e0711 default
parent child Browse files
Show More
@@ -1,482 +1,477 b''
1 1 $ remove() {
2 2 > hg rm $@
3 3 > echo "exit code: $?"
4 4 > hg st
5 5 > # do not use ls -R, which recurses in .hg subdirs on Mac OS X 10.5
6 6 > find . -name .hg -prune -o -type f -print | sort
7 7 > hg up -C
8 8 > }
9 9
10 10 $ cat >> $HGRCPATH <<EOF
11 11 > [progress]
12 12 > disable=False
13 13 > assume-tty = 1
14 14 > delay = 0
15 15 > # set changedelay really large so we don't see nested topics
16 16 > changedelay = 30000
17 17 > format = topic bar number
18 18 > refresh = 0
19 19 > width = 60
20 20 > EOF
21 21
22 22 $ hg init a
23 23 $ cd a
24 24 $ echo a > foo
25 25
26 26 file not managed
27 27
28 28 $ remove foo
29 29 \r (no-eol) (esc)
30 30 deleting [===========================================>] 1/1\r (no-eol) (esc)
31 31 \r (no-eol) (esc)
32 32 not removing foo: file is untracked
33 33 exit code: 1
34 34 ? foo
35 35 ./foo
36 36 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
37 37
38 38 $ hg add foo
39 39 $ hg commit -m1
40 40
41 41 the table cases
42 42 00 state added, options none
43 43
44 44 $ echo b > bar
45 45 $ hg add bar
46 46 $ remove bar
47 47 \r (no-eol) (esc)
48 48 deleting [===========================================>] 1/1\r (no-eol) (esc)
49 49 \r (no-eol) (esc)
50 50 \r (no-eol) (esc)
51 51 skipping [===========================================>] 1/1\r (no-eol) (esc)
52 52 \r (no-eol) (esc)
53 53 not removing bar: file has been marked for add (use forget to undo)
54 54 exit code: 1
55 55 A bar
56 56 ./bar
57 57 ./foo
58 58 \r (no-eol) (esc)
59 59 updating [===========================================>] 1/1\r (no-eol) (esc)
60 60 \r (no-eol) (esc)
61 61 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
62 62
63 63 01 state clean, options none
64 64
65 65 $ remove foo
66 66 \r (no-eol) (esc)
67 67 deleting [===========================================>] 1/1\r (no-eol) (esc)
68 68 \r (no-eol) (esc)
69 69 exit code: 0
70 70 R foo
71 71 ? bar
72 72 ./bar
73 73 \r (no-eol) (esc)
74 74 updating [===========================================>] 1/1\r (no-eol) (esc)
75 75 \r (no-eol) (esc)
76 76 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
77 77
78 78 02 state modified, options none
79 79
80 80 $ echo b >> foo
81 81 $ remove foo
82 82 \r (no-eol) (esc)
83 83 deleting [===========================================>] 1/1\r (no-eol) (esc)
84 84 \r (no-eol) (esc)
85 85 \r (no-eol) (esc)
86 86 skipping [===========================================>] 1/1\r (no-eol) (esc)
87 87 \r (no-eol) (esc)
88 88 not removing foo: file is modified (use -f to force removal)
89 89 exit code: 1
90 90 M foo
91 91 ? bar
92 92 ./bar
93 93 ./foo
94 94 \r (no-eol) (esc)
95 95 updating [===========================================>] 1/1\r (no-eol) (esc)
96 96 \r (no-eol) (esc)
97 97 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
98 98
99 99 03 state missing, options none
100 100
101 101 $ rm foo
102 102 $ remove foo
103 103 \r (no-eol) (esc)
104 104 deleting [===========================================>] 1/1\r (no-eol) (esc)
105 105 \r (no-eol) (esc)
106 106 exit code: 0
107 107 R foo
108 108 ? bar
109 109 ./bar
110 110 \r (no-eol) (esc)
111 111 updating [===========================================>] 1/1\r (no-eol) (esc)
112 112 \r (no-eol) (esc)
113 113 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
114 114
115 115 10 state added, options -f
116 116
117 117 $ echo b > bar
118 118 $ hg add bar
119 119 $ remove -f bar
120 120 \r (no-eol) (esc)
121 121 deleting [===========================================>] 1/1\r (no-eol) (esc)
122 122 \r (no-eol) (esc)
123 123 exit code: 0
124 124 ? bar
125 125 ./bar
126 126 ./foo
127 127 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
128 128 $ rm bar
129 129
130 130 11 state clean, options -f
131 131
132 132 $ remove -f foo
133 133 \r (no-eol) (esc)
134 134 deleting [===========================================>] 1/1\r (no-eol) (esc)
135 135 \r (no-eol) (esc)
136 136 exit code: 0
137 137 R foo
138 138 \r (no-eol) (esc)
139 139 updating [===========================================>] 1/1\r (no-eol) (esc)
140 140 \r (no-eol) (esc)
141 141 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
142 142
143 143 12 state modified, options -f
144 144
145 145 $ echo b >> foo
146 146 $ remove -f foo
147 147 \r (no-eol) (esc)
148 148 deleting [===========================================>] 1/1\r (no-eol) (esc)
149 149 \r (no-eol) (esc)
150 150 exit code: 0
151 151 R foo
152 152 \r (no-eol) (esc)
153 153 updating [===========================================>] 1/1\r (no-eol) (esc)
154 154 \r (no-eol) (esc)
155 155 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
156 156
157 157 13 state missing, options -f
158 158
159 159 $ rm foo
160 160 $ remove -f foo
161 161 \r (no-eol) (esc)
162 162 deleting [===========================================>] 1/1\r (no-eol) (esc)
163 163 \r (no-eol) (esc)
164 164 exit code: 0
165 165 R foo
166 166 \r (no-eol) (esc)
167 167 updating [===========================================>] 1/1\r (no-eol) (esc)
168 168 \r (no-eol) (esc)
169 169 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
170 170
171 171 20 state added, options -A
172 172
173 173 $ echo b > bar
174 174 $ hg add bar
175 175 $ remove -A bar
176 176 \r (no-eol) (esc)
177 177 deleting [===========================================>] 1/1\r (no-eol) (esc)
178 178 \r (no-eol) (esc)
179 179 \r (no-eol) (esc)
180 180 skipping [===========================================>] 1/1\r (no-eol) (esc)
181 181 \r (no-eol) (esc)
182 182 not removing bar: file still exists
183 183 exit code: 1
184 184 A bar
185 185 ./bar
186 186 ./foo
187 187 \r (no-eol) (esc)
188 188 updating [===========================================>] 1/1\r (no-eol) (esc)
189 189 \r (no-eol) (esc)
190 190 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
191 191
192 192 21 state clean, options -A
193 193
194 194 $ remove -A foo
195 195 \r (no-eol) (esc)
196 196 deleting [===========================================>] 1/1\r (no-eol) (esc)
197 197 \r (no-eol) (esc)
198 198 \r (no-eol) (esc)
199 199 skipping [===========================================>] 1/1\r (no-eol) (esc)
200 200 \r (no-eol) (esc)
201 201 not removing foo: file still exists
202 202 exit code: 1
203 203 ? bar
204 204 ./bar
205 205 ./foo
206 206 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
207 207
208 208 22 state modified, options -A
209 209
210 210 $ echo b >> foo
211 211 $ remove -A foo
212 212 \r (no-eol) (esc)
213 213 deleting [===========================================>] 1/1\r (no-eol) (esc)
214 214 \r (no-eol) (esc)
215 215 \r (no-eol) (esc)
216 216 skipping [===========================================>] 1/1\r (no-eol) (esc)
217 217 \r (no-eol) (esc)
218 218 not removing foo: file still exists
219 219 exit code: 1
220 220 M foo
221 221 ? bar
222 222 ./bar
223 223 ./foo
224 224 \r (no-eol) (esc)
225 225 updating [===========================================>] 1/1\r (no-eol) (esc)
226 226 \r (no-eol) (esc)
227 227 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
228 228
229 229 23 state missing, options -A
230 230
231 231 $ rm foo
232 232 $ remove -A foo
233 233 \r (no-eol) (esc)
234 234 deleting [===========================================>] 1/1\r (no-eol) (esc)
235 235 \r (no-eol) (esc)
236 236 exit code: 0
237 237 R foo
238 238 ? bar
239 239 ./bar
240 240 \r (no-eol) (esc)
241 241 updating [===========================================>] 1/1\r (no-eol) (esc)
242 242 \r (no-eol) (esc)
243 243 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
244 244
245 245 30 state added, options -Af
246 246
247 247 $ echo b > bar
248 248 $ hg add bar
249 249 $ remove -Af bar
250 250 \r (no-eol) (esc)
251 251 deleting [===========================================>] 1/1\r (no-eol) (esc)
252 252 \r (no-eol) (esc)
253 253 exit code: 0
254 254 ? bar
255 255 ./bar
256 256 ./foo
257 257 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
258 258 $ rm bar
259 259
260 260 31 state clean, options -Af
261 261
262 262 $ remove -Af foo
263 263 \r (no-eol) (esc)
264 264 deleting [===========================================>] 1/1\r (no-eol) (esc)
265 265 \r (no-eol) (esc)
266 266 exit code: 0
267 267 R foo
268 268 ./foo
269 269 \r (no-eol) (esc)
270 270 updating [===========================================>] 1/1\r (no-eol) (esc)
271 271 \r (no-eol) (esc)
272 272 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
273 273
274 274 32 state modified, options -Af
275 275
276 276 $ echo b >> foo
277 277 $ remove -Af foo
278 278 \r (no-eol) (esc)
279 279 deleting [===========================================>] 1/1\r (no-eol) (esc)
280 280 \r (no-eol) (esc)
281 281 exit code: 0
282 282 R foo
283 283 ./foo
284 284 \r (no-eol) (esc)
285 285 updating [===========================================>] 1/1\r (no-eol) (esc)
286 286 \r (no-eol) (esc)
287 287 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
288 288
289 289 33 state missing, options -Af
290 290
291 291 $ rm foo
292 292 $ remove -Af foo
293 293 \r (no-eol) (esc)
294 294 deleting [===========================================>] 1/1\r (no-eol) (esc)
295 295 \r (no-eol) (esc)
296 296 exit code: 0
297 297 R foo
298 298 \r (no-eol) (esc)
299 299 updating [===========================================>] 1/1\r (no-eol) (esc)
300 300 \r (no-eol) (esc)
301 301 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
302 302
303 303 test some directory stuff
304 304
305 305 $ mkdir test
306 306 $ echo a > test/foo
307 307 $ echo b > test/bar
308 308 $ hg ci -Am2
309 309 adding test/bar
310 310 adding test/foo
311 311
312 312 dir, options none
313 313
314 314 $ rm test/bar
315 315 $ remove test
316 316 \r (no-eol) (esc)
317 317 deleting [===========================================>] 1/1\r (no-eol) (esc)
318 318 \r (no-eol) (esc)
319 319 \r (no-eol) (esc)
320 320 deleting [=====================> ] 1/2\r (no-eol) (esc)
321 321 \r (no-eol) (esc)
322 322 \r (no-eol) (esc)
323 323 deleting [===========================================>] 2/2\r (no-eol) (esc)
324 324 \r (no-eol) (esc)
325 325 \r (no-eol) (esc)
326 326 \r (no-eol) (esc)
327 327 removing test/bar (glob)
328 328 removing test/foo (glob)
329 329 exit code: 0
330 330 R test/bar
331 331 R test/foo
332 332 ./foo
333 333 \r (no-eol) (esc)
334 334 updating [===========================================>] 2/2\r (no-eol) (esc)
335 335 \r (no-eol) (esc)
336 336 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
337 337
338 338 dir, options -f
339 339
340 340 $ rm test/bar
341 341 $ remove -f test
342 342 \r (no-eol) (esc)
343 343 deleting [===========================================>] 1/1\r (no-eol) (esc)
344 344 \r (no-eol) (esc)
345 345 \r (no-eol) (esc)
346 346 deleting [=====================> ] 1/2\r (no-eol) (esc)
347 347 \r (no-eol) (esc)
348 348 \r (no-eol) (esc)
349 349 deleting [===========================================>] 2/2\r (no-eol) (esc)
350 350 \r (no-eol) (esc)
351 351 \r (no-eol) (esc)
352 352 \r (no-eol) (esc)
353 353 removing test/bar (glob)
354 354 removing test/foo (glob)
355 355 exit code: 0
356 356 R test/bar
357 357 R test/foo
358 358 ./foo
359 359 \r (no-eol) (esc)
360 360 updating [===========================================>] 2/2\r (no-eol) (esc)
361 361 \r (no-eol) (esc)
362 362 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
363 363
364 364 dir, options -A
365 365
366 366 $ rm test/bar
367 367 $ remove -A test
368 368 \r (no-eol) (esc)
369 369 deleting [===========================================>] 1/1\r (no-eol) (esc)
370 370 \r (no-eol) (esc)
371 371 \r (no-eol) (esc)
372 372 skipping [===========================================>] 1/1\r (no-eol) (esc)
373 373 \r (no-eol) (esc)
374 374 \r (no-eol) (esc)
375 375 deleting [===========================================>] 1/1\r (no-eol) (esc)
376 376 \r (no-eol) (esc)
377 377 \r (no-eol) (esc)
378 378 \r (no-eol) (esc)
379 379 removing test/bar (glob)
380 380 not removing test/foo: file still exists (glob)
381 381 exit code: 1
382 382 R test/bar
383 383 ./foo
384 384 ./test/foo
385 385 \r (no-eol) (esc)
386 386 updating [===========================================>] 1/1\r (no-eol) (esc)
387 387 \r (no-eol) (esc)
388 388 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
389 389
390 390 dir, options -Af
391 391
392 392 $ rm test/bar
393 393 $ remove -Af test
394 394 \r (no-eol) (esc)
395 395 deleting [===========================================>] 1/1\r (no-eol) (esc)
396 396 \r (no-eol) (esc)
397 397 \r (no-eol) (esc)
398 398 deleting [=====================> ] 1/2\r (no-eol) (esc)
399 399 \r (no-eol) (esc)
400 400 \r (no-eol) (esc)
401 401 deleting [===========================================>] 2/2\r (no-eol) (esc)
402 402 \r (no-eol) (esc)
403 403 \r (no-eol) (esc)
404 404 \r (no-eol) (esc)
405 405 removing test/bar (glob)
406 406 removing test/foo (glob)
407 407 exit code: 0
408 408 R test/bar
409 409 R test/foo
410 410 ./foo
411 411 ./test/foo
412 412 \r (no-eol) (esc)
413 413 updating [===========================================>] 2/2\r (no-eol) (esc)
414 414 \r (no-eol) (esc)
415 415 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
416 416
417 417 test remove dropping empty trees (issue1861)
418 418
419 419 $ mkdir -p issue1861/b/c
420 420 $ echo x > issue1861/x
421 421 $ echo y > issue1861/b/c/y
422 422 $ hg ci -Am add
423 423 adding issue1861/b/c/y
424 424 adding issue1861/x
425 425 $ hg rm issue1861/b
426 426 \r (no-eol) (esc)
427 427 deleting [===========================================>] 1/1\r (no-eol) (esc)
428 428 \r (no-eol) (esc)
429 429 \r (no-eol) (esc)
430 430 deleting [===========================================>] 1/1\r (no-eol) (esc)
431 431 \r (no-eol) (esc)
432 432 \r (no-eol) (esc)
433 433 \r (no-eol) (esc)
434 434 removing issue1861/b/c/y (glob)
435 435 $ hg ci -m remove
436 436 $ ls issue1861
437 437 x
438 438
439 439 test that commit does not crash if the user removes a newly added file
440 440
441 441 $ touch f1
442 442 $ hg add f1
443 443 $ rm f1
444 444 $ hg ci -A -mx
445 445 removing f1
446 446 nothing changed
447 447 [1]
448 448
449 449 handling of untracked directories and missing files
450 450
451 451 $ mkdir d1
452 452 $ echo a > d1/a
453 453 $ hg rm --after d1
454 454 \r (no-eol) (esc)
455 455 deleting [===========================================>] 1/1\r (no-eol) (esc)
456 456 \r (no-eol) (esc)
457 457 not removing d1: no tracked files
458 458 [1]
459 459 $ hg add d1/a
460 460 $ rm d1/a
461 461 $ hg rm --after d1
462 462 \r (no-eol) (esc)
463 463 deleting [===========================================>] 1/1\r (no-eol) (esc)
464 464 \r (no-eol) (esc)
465 465 \r (no-eol) (esc)
466 466 deleting [===========================================>] 1/1\r (no-eol) (esc)
467 467 \r (no-eol) (esc)
468 468 \r (no-eol) (esc)
469 469 \r (no-eol) (esc)
470 470 removing d1/a (glob)
471 #if windows
471
472 472 $ hg rm --after nosuch
473 473 nosuch: * (glob)
474 [1]
475 #else
476 $ hg rm --after nosuch
477 nosuch: No such file or directory
478 474 \r (no-eol) (esc)
479 475 deleting [===========================================>] 1/1\r (no-eol) (esc)
480 476 \r (no-eol) (esc)
481 477 [1]
482 #endif
General Comments 0
You need to be logged in to leave comments. Login now