##// END OF EJS Templates
test-status.t: test ui.slash on Windows
Patrick Mezard -
r17377:a10f7eeb default
parent child Browse files
Show More
@@ -1,333 +1,338 b''
1 $ hg init repo1
1 $ hg init repo1
2 $ cd repo1
2 $ cd repo1
3 $ mkdir a b a/1 b/1 b/2
3 $ mkdir a b a/1 b/1 b/2
4 $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2
4 $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2
5
5
6 hg status in repo root:
6 hg status in repo root:
7
7
8 $ hg status
8 $ hg status
9 ? a/1/in_a_1
9 ? a/1/in_a_1
10 ? a/in_a
10 ? a/in_a
11 ? b/1/in_b_1
11 ? b/1/in_b_1
12 ? b/2/in_b_2
12 ? b/2/in_b_2
13 ? b/in_b
13 ? b/in_b
14 ? in_root
14 ? in_root
15
15
16 hg status . in repo root:
16 hg status . in repo root:
17
17
18 $ hg status .
18 $ hg status .
19 ? a/1/in_a_1
19 ? a/1/in_a_1
20 ? a/in_a
20 ? a/in_a
21 ? b/1/in_b_1
21 ? b/1/in_b_1
22 ? b/2/in_b_2
22 ? b/2/in_b_2
23 ? b/in_b
23 ? b/in_b
24 ? in_root
24 ? in_root
25
25
26 $ hg status --cwd a
26 $ hg status --cwd a
27 ? a/1/in_a_1
27 ? a/1/in_a_1
28 ? a/in_a
28 ? a/in_a
29 ? b/1/in_b_1
29 ? b/1/in_b_1
30 ? b/2/in_b_2
30 ? b/2/in_b_2
31 ? b/in_b
31 ? b/in_b
32 ? in_root
32 ? in_root
33 $ hg status --cwd a .
33 $ hg status --cwd a .
34 ? 1/in_a_1
34 ? 1/in_a_1
35 ? in_a
35 ? in_a
36 $ hg status --cwd a ..
36 $ hg status --cwd a ..
37 ? 1/in_a_1
37 ? 1/in_a_1
38 ? in_a
38 ? in_a
39 ? ../b/1/in_b_1
39 ? ../b/1/in_b_1
40 ? ../b/2/in_b_2
40 ? ../b/2/in_b_2
41 ? ../b/in_b
41 ? ../b/in_b
42 ? ../in_root
42 ? ../in_root
43
43
44 $ hg status --cwd b
44 $ hg status --cwd b
45 ? a/1/in_a_1
45 ? a/1/in_a_1
46 ? a/in_a
46 ? a/in_a
47 ? b/1/in_b_1
47 ? b/1/in_b_1
48 ? b/2/in_b_2
48 ? b/2/in_b_2
49 ? b/in_b
49 ? b/in_b
50 ? in_root
50 ? in_root
51 $ hg status --cwd b .
51 $ hg status --cwd b .
52 ? 1/in_b_1
52 ? 1/in_b_1
53 ? 2/in_b_2
53 ? 2/in_b_2
54 ? in_b
54 ? in_b
55 $ hg status --cwd b ..
55 $ hg status --cwd b ..
56 ? ../a/1/in_a_1
56 ? ../a/1/in_a_1
57 ? ../a/in_a
57 ? ../a/in_a
58 ? 1/in_b_1
58 ? 1/in_b_1
59 ? 2/in_b_2
59 ? 2/in_b_2
60 ? in_b
60 ? in_b
61 ? ../in_root
61 ? ../in_root
62
62
63 $ hg status --cwd a/1
63 $ hg status --cwd a/1
64 ? a/1/in_a_1
64 ? a/1/in_a_1
65 ? a/in_a
65 ? a/in_a
66 ? b/1/in_b_1
66 ? b/1/in_b_1
67 ? b/2/in_b_2
67 ? b/2/in_b_2
68 ? b/in_b
68 ? b/in_b
69 ? in_root
69 ? in_root
70 $ hg status --cwd a/1 .
70 $ hg status --cwd a/1 .
71 ? in_a_1
71 ? in_a_1
72 $ hg status --cwd a/1 ..
72 $ hg status --cwd a/1 ..
73 ? in_a_1
73 ? in_a_1
74 ? ../in_a
74 ? ../in_a
75
75
76 $ hg status --cwd b/1
76 $ hg status --cwd b/1
77 ? a/1/in_a_1
77 ? a/1/in_a_1
78 ? a/in_a
78 ? a/in_a
79 ? b/1/in_b_1
79 ? b/1/in_b_1
80 ? b/2/in_b_2
80 ? b/2/in_b_2
81 ? b/in_b
81 ? b/in_b
82 ? in_root
82 ? in_root
83 $ hg status --cwd b/1 .
83 $ hg status --cwd b/1 .
84 ? in_b_1
84 ? in_b_1
85 $ hg status --cwd b/1 ..
85 $ hg status --cwd b/1 ..
86 ? in_b_1
86 ? in_b_1
87 ? ../2/in_b_2
87 ? ../2/in_b_2
88 ? ../in_b
88 ? ../in_b
89
89
90 $ hg status --cwd b/2
90 $ hg status --cwd b/2
91 ? a/1/in_a_1
91 ? a/1/in_a_1
92 ? a/in_a
92 ? a/in_a
93 ? b/1/in_b_1
93 ? b/1/in_b_1
94 ? b/2/in_b_2
94 ? b/2/in_b_2
95 ? b/in_b
95 ? b/in_b
96 ? in_root
96 ? in_root
97 $ hg status --cwd b/2 .
97 $ hg status --cwd b/2 .
98 ? in_b_2
98 ? in_b_2
99 $ hg status --cwd b/2 ..
99 $ hg status --cwd b/2 ..
100 ? ../1/in_b_1
100 ? ../1/in_b_1
101 ? in_b_2
101 ? in_b_2
102 ? ../in_b
102 ? ../in_b
103 $ cd ..
103 $ cd ..
104
104
105 $ hg init repo2
105 $ hg init repo2
106 $ cd repo2
106 $ cd repo2
107 $ touch modified removed deleted ignored
107 $ touch modified removed deleted ignored
108 $ echo "^ignored$" > .hgignore
108 $ echo "^ignored$" > .hgignore
109 $ hg ci -A -m 'initial checkin'
109 $ hg ci -A -m 'initial checkin'
110 adding .hgignore
110 adding .hgignore
111 adding deleted
111 adding deleted
112 adding modified
112 adding modified
113 adding removed
113 adding removed
114 $ touch modified added unknown ignored
114 $ touch modified added unknown ignored
115 $ hg add added
115 $ hg add added
116 $ hg remove removed
116 $ hg remove removed
117 $ rm deleted
117 $ rm deleted
118
118
119 hg status:
119 hg status:
120
120
121 $ hg status
121 $ hg status
122 A added
122 A added
123 R removed
123 R removed
124 ! deleted
124 ! deleted
125 ? unknown
125 ? unknown
126
126
127 hg status modified added removed deleted unknown never-existed ignored:
127 hg status modified added removed deleted unknown never-existed ignored:
128
128
129 $ hg status modified added removed deleted unknown never-existed ignored
129 $ hg status modified added removed deleted unknown never-existed ignored
130 never-existed: * (glob)
130 never-existed: * (glob)
131 A added
131 A added
132 R removed
132 R removed
133 ! deleted
133 ! deleted
134 ? unknown
134 ? unknown
135
135
136 $ hg copy modified copied
136 $ hg copy modified copied
137
137
138 hg status -C:
138 hg status -C:
139
139
140 $ hg status -C
140 $ hg status -C
141 A added
141 A added
142 A copied
142 A copied
143 modified
143 modified
144 R removed
144 R removed
145 ! deleted
145 ! deleted
146 ? unknown
146 ? unknown
147
147
148 hg status -A:
148 hg status -A:
149
149
150 $ hg status -A
150 $ hg status -A
151 A added
151 A added
152 A copied
152 A copied
153 modified
153 modified
154 R removed
154 R removed
155 ! deleted
155 ! deleted
156 ? unknown
156 ? unknown
157 I ignored
157 I ignored
158 C .hgignore
158 C .hgignore
159 C modified
159 C modified
160
160
161
161
162 $ echo "^ignoreddir$" > .hgignore
162 $ echo "^ignoreddir$" > .hgignore
163 $ mkdir ignoreddir
163 $ mkdir ignoreddir
164 $ touch ignoreddir/file
164 $ touch ignoreddir/file
165
165
166 hg status ignoreddir/file:
166 hg status ignoreddir/file:
167
167
168 $ hg status ignoreddir/file
168 $ hg status ignoreddir/file
169
169
170 hg status -i ignoreddir/file:
170 hg status -i ignoreddir/file:
171
171
172 $ hg status -i ignoreddir/file
172 $ hg status -i ignoreddir/file
173 I ignoreddir/file
173 I ignoreddir/file
174 $ cd ..
174 $ cd ..
175
175
176 Check 'status -q' and some combinations
176 Check 'status -q' and some combinations
177
177
178 $ hg init repo3
178 $ hg init repo3
179 $ cd repo3
179 $ cd repo3
180 $ touch modified removed deleted ignored
180 $ touch modified removed deleted ignored
181 $ echo "^ignored$" > .hgignore
181 $ echo "^ignored$" > .hgignore
182 $ hg commit -A -m 'initial checkin'
182 $ hg commit -A -m 'initial checkin'
183 adding .hgignore
183 adding .hgignore
184 adding deleted
184 adding deleted
185 adding modified
185 adding modified
186 adding removed
186 adding removed
187 $ touch added unknown ignored
187 $ touch added unknown ignored
188 $ hg add added
188 $ hg add added
189 $ echo "test" >> modified
189 $ echo "test" >> modified
190 $ hg remove removed
190 $ hg remove removed
191 $ rm deleted
191 $ rm deleted
192 $ hg copy modified copied
192 $ hg copy modified copied
193
193
194 Run status with 2 different flags.
194 Run status with 2 different flags.
195 Check if result is the same or different.
195 Check if result is the same or different.
196 If result is not as expected, raise error
196 If result is not as expected, raise error
197
197
198 $ assert() {
198 $ assert() {
199 > hg status $1 > ../a
199 > hg status $1 > ../a
200 > hg status $2 > ../b
200 > hg status $2 > ../b
201 > if diff ../a ../b > /dev/null; then
201 > if diff ../a ../b > /dev/null; then
202 > out=0
202 > out=0
203 > else
203 > else
204 > out=1
204 > out=1
205 > fi
205 > fi
206 > if [ $3 -eq 0 ]; then
206 > if [ $3 -eq 0 ]; then
207 > df="same"
207 > df="same"
208 > else
208 > else
209 > df="different"
209 > df="different"
210 > fi
210 > fi
211 > if [ $out -ne $3 ]; then
211 > if [ $out -ne $3 ]; then
212 > echo "Error on $1 and $2, should be $df."
212 > echo "Error on $1 and $2, should be $df."
213 > fi
213 > fi
214 > }
214 > }
215
215
216 Assert flag1 flag2 [0-same | 1-different]
216 Assert flag1 flag2 [0-same | 1-different]
217
217
218 $ assert "-q" "-mard" 0
218 $ assert "-q" "-mard" 0
219 $ assert "-A" "-marduicC" 0
219 $ assert "-A" "-marduicC" 0
220 $ assert "-qA" "-mardcC" 0
220 $ assert "-qA" "-mardcC" 0
221 $ assert "-qAui" "-A" 0
221 $ assert "-qAui" "-A" 0
222 $ assert "-qAu" "-marducC" 0
222 $ assert "-qAu" "-marducC" 0
223 $ assert "-qAi" "-mardicC" 0
223 $ assert "-qAi" "-mardicC" 0
224 $ assert "-qu" "-u" 0
224 $ assert "-qu" "-u" 0
225 $ assert "-q" "-u" 1
225 $ assert "-q" "-u" 1
226 $ assert "-m" "-a" 1
226 $ assert "-m" "-a" 1
227 $ assert "-r" "-d" 1
227 $ assert "-r" "-d" 1
228 $ cd ..
228 $ cd ..
229
229
230 $ hg init repo4
230 $ hg init repo4
231 $ cd repo4
231 $ cd repo4
232 $ touch modified removed deleted
232 $ touch modified removed deleted
233 $ hg ci -q -A -m 'initial checkin'
233 $ hg ci -q -A -m 'initial checkin'
234 $ touch added unknown
234 $ touch added unknown
235 $ hg add added
235 $ hg add added
236 $ hg remove removed
236 $ hg remove removed
237 $ rm deleted
237 $ rm deleted
238 $ echo x > modified
238 $ echo x > modified
239 $ hg copy modified copied
239 $ hg copy modified copied
240 $ hg ci -m 'test checkin' -d "1000001 0"
240 $ hg ci -m 'test checkin' -d "1000001 0"
241 $ rm *
241 $ rm *
242 $ touch unrelated
242 $ touch unrelated
243 $ hg ci -q -A -m 'unrelated checkin' -d "1000002 0"
243 $ hg ci -q -A -m 'unrelated checkin' -d "1000002 0"
244
244
245 hg status --change 1:
245 hg status --change 1:
246
246
247 $ hg status --change 1
247 $ hg status --change 1
248 M modified
248 M modified
249 A added
249 A added
250 A copied
250 A copied
251 R removed
251 R removed
252
252
253 hg status --change 1 unrelated:
253 hg status --change 1 unrelated:
254
254
255 $ hg status --change 1 unrelated
255 $ hg status --change 1 unrelated
256
256
257 hg status -C --change 1 added modified copied removed deleted:
257 hg status -C --change 1 added modified copied removed deleted:
258
258
259 $ hg status -C --change 1 added modified copied removed deleted
259 $ hg status -C --change 1 added modified copied removed deleted
260 M modified
260 M modified
261 A added
261 A added
262 A copied
262 A copied
263 modified
263 modified
264 R removed
264 R removed
265
265
266 hg status -A --change 1 and revset:
266 hg status -A --change 1 and revset:
267
267
268 $ hg status -A --change '1|1'
268 $ hg status -A --change '1|1'
269 M modified
269 M modified
270 A added
270 A added
271 A copied
271 A copied
272 modified
272 modified
273 R removed
273 R removed
274 C deleted
274 C deleted
275
275
276 $ cd ..
276 $ cd ..
277
277
278 hg status of binary file starting with '\1\n', a separator for metadata:
278 hg status of binary file starting with '\1\n', a separator for metadata:
279
279
280 $ hg init repo5
280 $ hg init repo5
281 $ cd repo5
281 $ cd repo5
282 >>> open("010a", "wb").write("\1\nfoo")
282 >>> open("010a", "wb").write("\1\nfoo")
283 $ hg ci -q -A -m 'initial checkin'
283 $ hg ci -q -A -m 'initial checkin'
284 $ hg status -A
284 $ hg status -A
285 C 010a
285 C 010a
286
286
287 >>> open("010a", "wb").write("\1\nbar")
287 >>> open("010a", "wb").write("\1\nbar")
288 $ hg status -A
288 $ hg status -A
289 M 010a
289 M 010a
290 $ hg ci -q -m 'modify 010a'
290 $ hg ci -q -m 'modify 010a'
291 $ hg status -A --rev 0:1
291 $ hg status -A --rev 0:1
292 M 010a
292 M 010a
293
293
294 $ touch empty
294 $ touch empty
295 $ hg ci -q -A -m 'add another file'
295 $ hg ci -q -A -m 'add another file'
296 $ hg status -A --rev 1:2 010a
296 $ hg status -A --rev 1:2 010a
297 C 010a
297 C 010a
298
298
299 $ cd ..
299 $ cd ..
300
300
301 test "hg status" with "directory pattern" which matches against files
301 test "hg status" with "directory pattern" which matches against files
302 only known on target revision.
302 only known on target revision.
303
303
304 $ hg init repo6
304 $ hg init repo6
305 $ cd repo6
305 $ cd repo6
306
306
307 $ echo a > a.txt
307 $ echo a > a.txt
308 $ hg add a.txt
308 $ hg add a.txt
309 $ hg commit -m '#0'
309 $ hg commit -m '#0'
310 $ mkdir -p 1/2/3/4/5
310 $ mkdir -p 1/2/3/4/5
311 $ echo b > 1/2/3/4/5/b.txt
311 $ echo b > 1/2/3/4/5/b.txt
312 $ hg add 1/2/3/4/5/b.txt
312 $ hg add 1/2/3/4/5/b.txt
313 $ hg commit -m '#1'
313 $ hg commit -m '#1'
314
314
315 $ hg update -C 0 > /dev/null
315 $ hg update -C 0 > /dev/null
316 $ hg status -A
316 $ hg status -A
317 C a.txt
317 C a.txt
318
318
319 the directory matching against specified pattern should be removed,
319 the directory matching against specified pattern should be removed,
320 because directory existence prevents 'dirstate.walk()' from showing
320 because directory existence prevents 'dirstate.walk()' from showing
321 warning message about such pattern.
321 warning message about such pattern.
322
322
323 $ test ! -d 1
323 $ test ! -d 1
324 $ hg status -A --rev 1 1/2/3/4/5/b.txt
324 $ hg status -A --rev 1 1/2/3/4/5/b.txt
325 R 1/2/3/4/5/b.txt
325 R 1/2/3/4/5/b.txt
326 $ hg status -A --rev 1 1/2/3/4/5
326 $ hg status -A --rev 1 1/2/3/4/5
327 R 1/2/3/4/5/b.txt
327 R 1/2/3/4/5/b.txt
328 $ hg status -A --rev 1 1/2/3
328 $ hg status -A --rev 1 1/2/3
329 R 1/2/3/4/5/b.txt
329 R 1/2/3/4/5/b.txt
330 $ hg status -A --rev 1 1
330 $ hg status -A --rev 1 1
331 R 1/2/3/4/5/b.txt
331 R 1/2/3/4/5/b.txt
332
332
333 #if windows
334 $ hg --config ui.slash=false status -A --rev 1 1
335 R 1\2\3\4\5\b.txt
336 #endif
337
333 $ cd ..
338 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now