comparison tests/test-remove.t @ 12099:54c9549ccb22

tests: unify test-remove
author Nicolas Dumazet <nicdumz.commits@gmail.com>
date Mon, 30 Aug 2010 13:02:54 +0900
parents tests/test-remove@1f665246dab3
children 48735ce02345
comparison
equal deleted inserted replaced
12098:12108d7f2ce1 12099:54c9549ccb22
1 $ remove() {
2 > hg rm $@
3 > hg st
4 > # do not use ls -R, which recurses in .hg subdirs on Mac OS X 10.5
5 > find . -name .hg -prune -o -type f -print | sort
6 > hg up -C
7 > }
8
9 $ hg init a
10 $ cd a
11 $ echo a > foo
12
13 file not managed
14
15 $ remove foo
16 not removing foo: file is untracked
17 ? foo
18 ./foo
19 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
20
21 $ hg add foo
22 $ hg commit -m1
23
24 the table cases
25 00 state added, options none
26
27 $ echo b > bar
28 $ hg add bar
29 $ remove bar
30 not removing bar: file has been marked for add (use -f to force removal)
31 A bar
32 ./bar
33 ./foo
34 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
35
36 01 state clean, options none
37
38 $ remove foo
39 R foo
40 ? bar
41 ./bar
42 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
43
44 02 state modified, options none
45
46 $ echo b >> foo
47 $ remove foo
48 not removing foo: file is modified (use -f to force removal)
49 M foo
50 ? bar
51 ./bar
52 ./foo
53 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
54
55 03 state missing, options none
56
57 $ rm foo
58 $ remove foo
59 R foo
60 ? bar
61 ./bar
62 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
63
64 10 state added, options -f
65
66 $ echo b > bar
67 $ hg add bar
68 $ remove -f bar
69 ? bar
70 ./bar
71 ./foo
72 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
73 $ rm bar
74
75 11 state clean, options -f
76
77 $ remove -f foo
78 R foo
79 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
80
81 12 state modified, options -f
82
83 $ echo b >> foo
84 $ remove -f foo
85 R foo
86 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
87
88 13 state missing, options -f
89
90 $ rm foo
91 $ remove -f foo
92 R foo
93 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
94
95 20 state added, options -A
96
97 $ echo b > bar
98 $ hg add bar
99 $ remove -A bar
100 not removing bar: file still exists (use -f to force removal)
101 A bar
102 ./bar
103 ./foo
104 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
105
106 21 state clean, options -A
107
108 $ remove -A foo
109 not removing foo: file still exists (use -f to force removal)
110 ? bar
111 ./bar
112 ./foo
113 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
114
115 22 state modified, options -A
116
117 $ echo b >> foo
118 $ remove -A foo
119 not removing foo: file still exists (use -f to force removal)
120 M foo
121 ? bar
122 ./bar
123 ./foo
124 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
125
126 23 state missing, options -A
127
128 $ rm foo
129 $ remove -A foo
130 R foo
131 ? bar
132 ./bar
133 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
134
135 30 state added, options -Af
136
137 $ echo b > bar
138 $ hg add bar
139 $ remove -Af bar
140 ? bar
141 ./bar
142 ./foo
143 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
144 $ rm bar
145
146 31 state clean, options -Af
147
148 $ remove -Af foo
149 R foo
150 ./foo
151 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
152
153 32 state modified, options -Af
154
155 $ echo b >> foo
156 $ remove -Af foo
157 R foo
158 ./foo
159 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
160
161 33 state missing, options -Af
162
163 $ rm foo
164 $ remove -Af foo
165 R foo
166 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
167
168 test some directory stuff
169
170 $ mkdir test
171 $ echo a > test/foo
172 $ echo b > test/bar
173 $ hg ci -Am2
174 adding test/bar
175 adding test/foo
176
177 dir, options none
178
179 $ rm test/bar
180 $ remove test
181 removing test/bar
182 removing test/foo
183 R test/bar
184 R test/foo
185 ./foo
186 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
187
188 dir, options -f
189
190 $ rm test/bar
191 $ remove -f test
192 removing test/bar
193 removing test/foo
194 R test/bar
195 R test/foo
196 ./foo
197 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
198
199 dir, options -A
200
201 $ rm test/bar
202 $ remove -A test
203 not removing test/foo: file still exists (use -f to force removal)
204 removing test/bar
205 R test/bar
206 ./foo
207 ./test/foo
208 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
209
210 dir, options -Af
211
212 $ rm test/bar
213 $ remove -Af test
214 removing test/bar
215 removing test/foo
216 R test/bar
217 R test/foo
218 ./foo
219 ./test/foo
220 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
221
222 test remove dropping empty trees (issue1861)
223
224 $ mkdir -p issue1861/b/c
225 $ echo x > issue1861/x
226 $ echo y > issue1861/b/c/y
227 $ hg ci -Am add
228 adding issue1861/b/c/y
229 adding issue1861/x
230 $ hg rm issue1861/b
231 removing issue1861/b/c/y
232 $ hg ci -m remove
233 $ ls issue1861
234 x