annotate tests/test-remove @ 12378:ab237534d800 stable

mq: always require --force when pushing patches (issue2363) --force was not necessary when passing --rev since 55578a8d7e84, but this behaviour is usually harmful when branch names are passed instead of explicit revisions.
author Patrick Mezard <pmezard@gmail.com>
date Wed, 22 Sep 2010 23:51:10 +0200
parents 07ac2a560fce
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
936
b62d1e738fa9 Add a simple remove test
mpm@selenic.com
parents:
diff changeset
1 #!/bin/sh
b62d1e738fa9 Add a simple remove test
mpm@selenic.com
parents:
diff changeset
2
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
3 remove() {
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
4 hg rm $@
12129
07ac2a560fce remove: properly set return code when warnings are issued
Brodie Rao <brodie@bitheap.org>
parents: 9572
diff changeset
5 echo "exit code: $?"
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
6 hg st
6356
b34b876d1f6f test-remove: make it pass on Mac OS X 10.5
Florent Guillaume <fg@nuxeo.com>
parents: 6346
diff changeset
7 # do not use ls -R, which recurses in .hg subdirs on Mac OS X 10.5
6358
7cb9af02e250 test-remove: make tests really pass
Florent Guillaume <fg@nuxeo.com>
parents: 6357
diff changeset
8 find . -name .hg -prune -o -type f -print | sort
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
9 hg up -C
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
10 }
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
11
936
b62d1e738fa9 Add a simple remove test
mpm@selenic.com
parents:
diff changeset
12 hg init a
b62d1e738fa9 Add a simple remove test
mpm@selenic.com
parents:
diff changeset
13 cd a
b62d1e738fa9 Add a simple remove test
mpm@selenic.com
parents:
diff changeset
14 echo a > foo
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
15
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
16 echo % file not managed
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
17 remove foo
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
18
936
b62d1e738fa9 Add a simple remove test
mpm@selenic.com
parents:
diff changeset
19 hg add foo
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
20 hg commit -m1
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
21
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
22 # the table cases
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
23
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
24 echo % 00 state added, options none
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
25 echo b > bar
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
26 hg add bar
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
27 remove bar
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
28
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
29 echo % 01 state clean, options none
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
30 remove foo
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
31
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
32 echo % 02 state modified, options none
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
33 echo b >> foo
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
34 remove foo
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
35
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
36 echo % 03 state missing, options none
936
b62d1e738fa9 Add a simple remove test
mpm@selenic.com
parents:
diff changeset
37 rm foo
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
38 remove foo
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
39
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
40 echo % 10 state added, options -f
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
41 echo b > bar
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
42 hg add bar
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
43 remove -f bar
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
44 rm bar
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
45
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
46 echo % 11 state clean, options -f
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
47 remove -f foo
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
48
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
49 echo % 12 state modified, options -f
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
50 echo b >> foo
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
51 remove -f foo
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
52
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
53 echo % 13 state missing, options -f
2180
82385773df6c make test-remove check some more cases.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 1953
diff changeset
54 rm foo
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
55 remove -f foo
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
56
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
57 echo % 20 state added, options -A
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
58 echo b > bar
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
59 hg add bar
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
60 remove -A bar
936
b62d1e738fa9 Add a simple remove test
mpm@selenic.com
parents:
diff changeset
61
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
62 echo % 21 state clean, options -A
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
63 remove -A foo
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
64
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
65 echo % 22 state modified, options -A
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
66 echo b >> foo
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
67 remove -A foo
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
68
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
69 echo % 23 state missing, options -A
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
70 rm foo
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
71 remove -A foo
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
72
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
73 echo % 30 state added, options -Af
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
74 echo b > bar
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
75 hg add bar
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
76 remove -Af bar
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
77 rm bar
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
78
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
79 echo % 31 state clean, options -Af
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
80 remove -Af foo
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
81
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
82 echo % 32 state modified, options -Af
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
83 echo b >> foo
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
84 remove -Af foo
2309
b2f37c7026ca remove: rewrite to be ~400x faster, bit more friendly
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2180
diff changeset
85
6346
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
86 echo % 33 state missing, options -Af
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
87 rm foo
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
88 remove -Af foo
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
89
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
90 # test some directory stuff
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
91
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
92 mkdir test
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
93 echo a > test/foo
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
94 echo b > test/bar
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
95 hg ci -Am2
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
96
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
97 echo % dir, options none
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
98 rm test/bar
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
99 remove test
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
100
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
101 echo % dir, options -f
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
102 rm test/bar
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
103 remove -f test
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
104
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
105 echo % dir, options -A
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
106 rm test/bar
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
107 remove -A test
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
108
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
109 echo % dir, options -Af
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
110 rm test/bar
8e3b651382f5 improved semantics for remove (issue438)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents: 4394
diff changeset
111 remove -Af test
9572
1f665246dab3 windows: fix unlink() not dropping empty tree (issue1861)
Patrick Mezard <pmezard@gmail.com>
parents: 6358
diff changeset
112
1f665246dab3 windows: fix unlink() not dropping empty tree (issue1861)
Patrick Mezard <pmezard@gmail.com>
parents: 6358
diff changeset
113 echo 'test remove dropping empty trees (issue1861)'
1f665246dab3 windows: fix unlink() not dropping empty tree (issue1861)
Patrick Mezard <pmezard@gmail.com>
parents: 6358
diff changeset
114 mkdir -p issue1861/b/c
1f665246dab3 windows: fix unlink() not dropping empty tree (issue1861)
Patrick Mezard <pmezard@gmail.com>
parents: 6358
diff changeset
115 echo x > issue1861/x
1f665246dab3 windows: fix unlink() not dropping empty tree (issue1861)
Patrick Mezard <pmezard@gmail.com>
parents: 6358
diff changeset
116 echo y > issue1861/b/c/y
1f665246dab3 windows: fix unlink() not dropping empty tree (issue1861)
Patrick Mezard <pmezard@gmail.com>
parents: 6358
diff changeset
117 hg ci -Am add
1f665246dab3 windows: fix unlink() not dropping empty tree (issue1861)
Patrick Mezard <pmezard@gmail.com>
parents: 6358
diff changeset
118 hg rm issue1861/b
1f665246dab3 windows: fix unlink() not dropping empty tree (issue1861)
Patrick Mezard <pmezard@gmail.com>
parents: 6358
diff changeset
119 hg ci -m remove
1f665246dab3 windows: fix unlink() not dropping empty tree (issue1861)
Patrick Mezard <pmezard@gmail.com>
parents: 6358
diff changeset
120 ls issue1861