##// END OF EJS Templates
tests: stop creating temporary files in TESTDIR
Arseniy Alekseyev -
r50503:2af928d6 stable
parent child Browse files
Show More
@@ -1,1002 +1,1002 b''
1 #testcases dirstate-v1 dirstate-v2
1 #testcases dirstate-v1 dirstate-v2
2
2
3 #if dirstate-v2
3 #if dirstate-v2
4 $ cat >> $HGRCPATH << EOF
4 $ cat >> $HGRCPATH << EOF
5 > [format]
5 > [format]
6 > use-dirstate-v2=1
6 > use-dirstate-v2=1
7 > [storage]
7 > [storage]
8 > dirstate-v2.slow-path=allow
8 > dirstate-v2.slow-path=allow
9 > EOF
9 > EOF
10 #endif
10 #endif
11
11
12 $ hg init repo1
12 $ hg init repo1
13 $ cd repo1
13 $ cd repo1
14 $ mkdir a b a/1 b/1 b/2
14 $ mkdir a b a/1 b/1 b/2
15 $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2
15 $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2
16
16
17 hg status in repo root:
17 hg status in repo root:
18
18
19 $ hg status
19 $ hg status
20 ? a/1/in_a_1
20 ? a/1/in_a_1
21 ? a/in_a
21 ? a/in_a
22 ? b/1/in_b_1
22 ? b/1/in_b_1
23 ? b/2/in_b_2
23 ? b/2/in_b_2
24 ? b/in_b
24 ? b/in_b
25 ? in_root
25 ? in_root
26
26
27 hg status . in repo root:
27 hg status . in repo root:
28
28
29 $ hg status .
29 $ hg status .
30 ? a/1/in_a_1
30 ? a/1/in_a_1
31 ? a/in_a
31 ? a/in_a
32 ? b/1/in_b_1
32 ? b/1/in_b_1
33 ? b/2/in_b_2
33 ? b/2/in_b_2
34 ? b/in_b
34 ? b/in_b
35 ? in_root
35 ? in_root
36
36
37 $ hg status --cwd a
37 $ hg status --cwd a
38 ? a/1/in_a_1
38 ? a/1/in_a_1
39 ? a/in_a
39 ? a/in_a
40 ? b/1/in_b_1
40 ? b/1/in_b_1
41 ? b/2/in_b_2
41 ? b/2/in_b_2
42 ? b/in_b
42 ? b/in_b
43 ? in_root
43 ? in_root
44 $ hg status --cwd a .
44 $ hg status --cwd a .
45 ? 1/in_a_1
45 ? 1/in_a_1
46 ? in_a
46 ? in_a
47 $ hg status --cwd a ..
47 $ hg status --cwd a ..
48 ? 1/in_a_1
48 ? 1/in_a_1
49 ? in_a
49 ? in_a
50 ? ../b/1/in_b_1
50 ? ../b/1/in_b_1
51 ? ../b/2/in_b_2
51 ? ../b/2/in_b_2
52 ? ../b/in_b
52 ? ../b/in_b
53 ? ../in_root
53 ? ../in_root
54
54
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 ? b/1/in_b_1
58 ? b/1/in_b_1
59 ? b/2/in_b_2
59 ? b/2/in_b_2
60 ? b/in_b
60 ? b/in_b
61 ? in_root
61 ? in_root
62 $ hg status --cwd b .
62 $ hg status --cwd b .
63 ? 1/in_b_1
63 ? 1/in_b_1
64 ? 2/in_b_2
64 ? 2/in_b_2
65 ? in_b
65 ? in_b
66 $ hg status --cwd b ..
66 $ hg status --cwd b ..
67 ? ../a/1/in_a_1
67 ? ../a/1/in_a_1
68 ? ../a/in_a
68 ? ../a/in_a
69 ? 1/in_b_1
69 ? 1/in_b_1
70 ? 2/in_b_2
70 ? 2/in_b_2
71 ? in_b
71 ? in_b
72 ? ../in_root
72 ? ../in_root
73
73
74 $ hg status --cwd a/1
74 $ hg status --cwd a/1
75 ? a/1/in_a_1
75 ? a/1/in_a_1
76 ? a/in_a
76 ? a/in_a
77 ? b/1/in_b_1
77 ? b/1/in_b_1
78 ? b/2/in_b_2
78 ? b/2/in_b_2
79 ? b/in_b
79 ? b/in_b
80 ? in_root
80 ? in_root
81 $ hg status --cwd a/1 .
81 $ hg status --cwd a/1 .
82 ? in_a_1
82 ? in_a_1
83 $ hg status --cwd a/1 ..
83 $ hg status --cwd a/1 ..
84 ? in_a_1
84 ? in_a_1
85 ? ../in_a
85 ? ../in_a
86
86
87 $ hg status --cwd b/1
87 $ hg status --cwd b/1
88 ? a/1/in_a_1
88 ? a/1/in_a_1
89 ? a/in_a
89 ? a/in_a
90 ? b/1/in_b_1
90 ? b/1/in_b_1
91 ? b/2/in_b_2
91 ? b/2/in_b_2
92 ? b/in_b
92 ? b/in_b
93 ? in_root
93 ? in_root
94 $ hg status --cwd b/1 .
94 $ hg status --cwd b/1 .
95 ? in_b_1
95 ? in_b_1
96 $ hg status --cwd b/1 ..
96 $ hg status --cwd b/1 ..
97 ? in_b_1
97 ? in_b_1
98 ? ../2/in_b_2
98 ? ../2/in_b_2
99 ? ../in_b
99 ? ../in_b
100
100
101 $ hg status --cwd b/2
101 $ hg status --cwd b/2
102 ? a/1/in_a_1
102 ? a/1/in_a_1
103 ? a/in_a
103 ? a/in_a
104 ? b/1/in_b_1
104 ? b/1/in_b_1
105 ? b/2/in_b_2
105 ? b/2/in_b_2
106 ? b/in_b
106 ? b/in_b
107 ? in_root
107 ? in_root
108 $ hg status --cwd b/2 .
108 $ hg status --cwd b/2 .
109 ? in_b_2
109 ? in_b_2
110 $ hg status --cwd b/2 ..
110 $ hg status --cwd b/2 ..
111 ? ../1/in_b_1
111 ? ../1/in_b_1
112 ? in_b_2
112 ? in_b_2
113 ? ../in_b
113 ? ../in_b
114
114
115 combining patterns with root and patterns without a root works
115 combining patterns with root and patterns without a root works
116
116
117 $ hg st a/in_a re:.*b$
117 $ hg st a/in_a re:.*b$
118 ? a/in_a
118 ? a/in_a
119 ? b/in_b
119 ? b/in_b
120
120
121 tweaking defaults works
121 tweaking defaults works
122 $ hg status --cwd a --config ui.tweakdefaults=yes
122 $ hg status --cwd a --config ui.tweakdefaults=yes
123 ? 1/in_a_1
123 ? 1/in_a_1
124 ? in_a
124 ? in_a
125 ? ../b/1/in_b_1
125 ? ../b/1/in_b_1
126 ? ../b/2/in_b_2
126 ? ../b/2/in_b_2
127 ? ../b/in_b
127 ? ../b/in_b
128 ? ../in_root
128 ? ../in_root
129 $ HGPLAIN=1 hg status --cwd a --config ui.tweakdefaults=yes
129 $ HGPLAIN=1 hg status --cwd a --config ui.tweakdefaults=yes
130 ? a/1/in_a_1 (glob)
130 ? a/1/in_a_1 (glob)
131 ? a/in_a (glob)
131 ? a/in_a (glob)
132 ? b/1/in_b_1 (glob)
132 ? b/1/in_b_1 (glob)
133 ? b/2/in_b_2 (glob)
133 ? b/2/in_b_2 (glob)
134 ? b/in_b (glob)
134 ? b/in_b (glob)
135 ? in_root
135 ? in_root
136 $ HGPLAINEXCEPT=tweakdefaults hg status --cwd a --config ui.tweakdefaults=yes
136 $ HGPLAINEXCEPT=tweakdefaults hg status --cwd a --config ui.tweakdefaults=yes
137 ? 1/in_a_1
137 ? 1/in_a_1
138 ? in_a
138 ? in_a
139 ? ../b/1/in_b_1
139 ? ../b/1/in_b_1
140 ? ../b/2/in_b_2
140 ? ../b/2/in_b_2
141 ? ../b/in_b
141 ? ../b/in_b
142 ? ../in_root (glob)
142 ? ../in_root (glob)
143
143
144 relative paths can be requested
144 relative paths can be requested
145
145
146 $ hg status --cwd a --config ui.relative-paths=yes
146 $ hg status --cwd a --config ui.relative-paths=yes
147 ? 1/in_a_1
147 ? 1/in_a_1
148 ? in_a
148 ? in_a
149 ? ../b/1/in_b_1
149 ? ../b/1/in_b_1
150 ? ../b/2/in_b_2
150 ? ../b/2/in_b_2
151 ? ../b/in_b
151 ? ../b/in_b
152 ? ../in_root
152 ? ../in_root
153
153
154 $ hg status --cwd a . --config ui.relative-paths=legacy
154 $ hg status --cwd a . --config ui.relative-paths=legacy
155 ? 1/in_a_1
155 ? 1/in_a_1
156 ? in_a
156 ? in_a
157 $ hg status --cwd a . --config ui.relative-paths=no
157 $ hg status --cwd a . --config ui.relative-paths=no
158 ? a/1/in_a_1
158 ? a/1/in_a_1
159 ? a/in_a
159 ? a/in_a
160
160
161 commands.status.relative overrides ui.relative-paths
161 commands.status.relative overrides ui.relative-paths
162
162
163 $ cat >> $HGRCPATH <<EOF
163 $ cat >> $HGRCPATH <<EOF
164 > [ui]
164 > [ui]
165 > relative-paths = False
165 > relative-paths = False
166 > [commands]
166 > [commands]
167 > status.relative = True
167 > status.relative = True
168 > EOF
168 > EOF
169 $ hg status --cwd a
169 $ hg status --cwd a
170 ? 1/in_a_1
170 ? 1/in_a_1
171 ? in_a
171 ? in_a
172 ? ../b/1/in_b_1
172 ? ../b/1/in_b_1
173 ? ../b/2/in_b_2
173 ? ../b/2/in_b_2
174 ? ../b/in_b
174 ? ../b/in_b
175 ? ../in_root
175 ? ../in_root
176 $ HGPLAIN=1 hg status --cwd a
176 $ HGPLAIN=1 hg status --cwd a
177 ? a/1/in_a_1 (glob)
177 ? a/1/in_a_1 (glob)
178 ? a/in_a (glob)
178 ? a/in_a (glob)
179 ? b/1/in_b_1 (glob)
179 ? b/1/in_b_1 (glob)
180 ? b/2/in_b_2 (glob)
180 ? b/2/in_b_2 (glob)
181 ? b/in_b (glob)
181 ? b/in_b (glob)
182 ? in_root
182 ? in_root
183
183
184 if relative paths are explicitly off, tweakdefaults doesn't change it
184 if relative paths are explicitly off, tweakdefaults doesn't change it
185 $ cat >> $HGRCPATH <<EOF
185 $ cat >> $HGRCPATH <<EOF
186 > [commands]
186 > [commands]
187 > status.relative = False
187 > status.relative = False
188 > EOF
188 > EOF
189 $ hg status --cwd a --config ui.tweakdefaults=yes
189 $ hg status --cwd a --config ui.tweakdefaults=yes
190 ? a/1/in_a_1
190 ? a/1/in_a_1
191 ? a/in_a
191 ? a/in_a
192 ? b/1/in_b_1
192 ? b/1/in_b_1
193 ? b/2/in_b_2
193 ? b/2/in_b_2
194 ? b/in_b
194 ? b/in_b
195 ? in_root
195 ? in_root
196
196
197 $ cd ..
197 $ cd ..
198
198
199 $ hg init repo2
199 $ hg init repo2
200 $ cd repo2
200 $ cd repo2
201 $ touch modified removed deleted ignored
201 $ touch modified removed deleted ignored
202 $ echo "^ignored$" > .hgignore
202 $ echo "^ignored$" > .hgignore
203 $ hg ci -A -m 'initial checkin'
203 $ hg ci -A -m 'initial checkin'
204 adding .hgignore
204 adding .hgignore
205 adding deleted
205 adding deleted
206 adding modified
206 adding modified
207 adding removed
207 adding removed
208 $ touch modified added unknown ignored
208 $ touch modified added unknown ignored
209 $ hg add added
209 $ hg add added
210 $ hg remove removed
210 $ hg remove removed
211 $ rm deleted
211 $ rm deleted
212
212
213 hg status:
213 hg status:
214
214
215 $ hg status
215 $ hg status
216 A added
216 A added
217 R removed
217 R removed
218 ! deleted
218 ! deleted
219 ? unknown
219 ? unknown
220
220
221 hg status -n:
221 hg status -n:
222 $ env RHG_ON_UNSUPPORTED=abort hg status -n
222 $ env RHG_ON_UNSUPPORTED=abort hg status -n
223 added
223 added
224 removed
224 removed
225 deleted
225 deleted
226 unknown
226 unknown
227
227
228 hg status modified added removed deleted unknown never-existed ignored:
228 hg status modified added removed deleted unknown never-existed ignored:
229
229
230 $ hg status modified added removed deleted unknown never-existed ignored
230 $ hg status modified added removed deleted unknown never-existed ignored
231 never-existed: * (glob)
231 never-existed: * (glob)
232 A added
232 A added
233 R removed
233 R removed
234 ! deleted
234 ! deleted
235 ? unknown
235 ? unknown
236
236
237 $ hg copy modified copied
237 $ hg copy modified copied
238
238
239 hg status -C:
239 hg status -C:
240
240
241 $ hg status -C
241 $ hg status -C
242 A added
242 A added
243 A copied
243 A copied
244 modified
244 modified
245 R removed
245 R removed
246 ! deleted
246 ! deleted
247 ? unknown
247 ? unknown
248
248
249 hg status -A:
249 hg status -A:
250
250
251 $ hg status -A
251 $ hg status -A
252 A added
252 A added
253 A copied
253 A copied
254 modified
254 modified
255 R removed
255 R removed
256 ! deleted
256 ! deleted
257 ? unknown
257 ? unknown
258 I ignored
258 I ignored
259 C .hgignore
259 C .hgignore
260 C modified
260 C modified
261
261
262 $ hg status -A -T '{status} {path} {node|shortest}\n'
262 $ hg status -A -T '{status} {path} {node|shortest}\n'
263 A added ffff
263 A added ffff
264 A copied ffff
264 A copied ffff
265 R removed ffff
265 R removed ffff
266 ! deleted ffff
266 ! deleted ffff
267 ? unknown ffff
267 ? unknown ffff
268 I ignored ffff
268 I ignored ffff
269 C .hgignore ffff
269 C .hgignore ffff
270 C modified ffff
270 C modified ffff
271
271
272 $ hg status -A -Tjson
272 $ hg status -A -Tjson
273 [
273 [
274 {
274 {
275 "itemtype": "file",
275 "itemtype": "file",
276 "path": "added",
276 "path": "added",
277 "status": "A"
277 "status": "A"
278 },
278 },
279 {
279 {
280 "itemtype": "file",
280 "itemtype": "file",
281 "path": "copied",
281 "path": "copied",
282 "source": "modified",
282 "source": "modified",
283 "status": "A"
283 "status": "A"
284 },
284 },
285 {
285 {
286 "itemtype": "file",
286 "itemtype": "file",
287 "path": "removed",
287 "path": "removed",
288 "status": "R"
288 "status": "R"
289 },
289 },
290 {
290 {
291 "itemtype": "file",
291 "itemtype": "file",
292 "path": "deleted",
292 "path": "deleted",
293 "status": "!"
293 "status": "!"
294 },
294 },
295 {
295 {
296 "itemtype": "file",
296 "itemtype": "file",
297 "path": "unknown",
297 "path": "unknown",
298 "status": "?"
298 "status": "?"
299 },
299 },
300 {
300 {
301 "itemtype": "file",
301 "itemtype": "file",
302 "path": "ignored",
302 "path": "ignored",
303 "status": "I"
303 "status": "I"
304 },
304 },
305 {
305 {
306 "itemtype": "file",
306 "itemtype": "file",
307 "path": ".hgignore",
307 "path": ".hgignore",
308 "status": "C"
308 "status": "C"
309 },
309 },
310 {
310 {
311 "itemtype": "file",
311 "itemtype": "file",
312 "path": "modified",
312 "path": "modified",
313 "status": "C"
313 "status": "C"
314 }
314 }
315 ]
315 ]
316
316
317 $ hg status -A -Tpickle > pickle
317 $ hg status -A -Tpickle > pickle
318 >>> import pickle
318 >>> import pickle
319 >>> from mercurial import util
319 >>> from mercurial import util
320 >>> data = sorted((x[b'status'].decode(), x[b'path'].decode()) for x in pickle.load(open("pickle", r"rb")))
320 >>> data = sorted((x[b'status'].decode(), x[b'path'].decode()) for x in pickle.load(open("pickle", r"rb")))
321 >>> for s, p in data: print("%s %s" % (s, p))
321 >>> for s, p in data: print("%s %s" % (s, p))
322 ! deleted
322 ! deleted
323 ? pickle
323 ? pickle
324 ? unknown
324 ? unknown
325 A added
325 A added
326 A copied
326 A copied
327 C .hgignore
327 C .hgignore
328 C modified
328 C modified
329 I ignored
329 I ignored
330 R removed
330 R removed
331 $ rm pickle
331 $ rm pickle
332
332
333 $ echo "^ignoreddir$" > .hgignore
333 $ echo "^ignoreddir$" > .hgignore
334 $ mkdir ignoreddir
334 $ mkdir ignoreddir
335 $ touch ignoreddir/file
335 $ touch ignoreddir/file
336
336
337 Test templater support:
337 Test templater support:
338
338
339 $ hg status -AT "[{status}]\t{if(source, '{source} -> ')}{path}\n"
339 $ hg status -AT "[{status}]\t{if(source, '{source} -> ')}{path}\n"
340 [M] .hgignore
340 [M] .hgignore
341 [A] added
341 [A] added
342 [A] modified -> copied
342 [A] modified -> copied
343 [R] removed
343 [R] removed
344 [!] deleted
344 [!] deleted
345 [?] ignored
345 [?] ignored
346 [?] unknown
346 [?] unknown
347 [I] ignoreddir/file
347 [I] ignoreddir/file
348 [C] modified
348 [C] modified
349 $ hg status -AT default
349 $ hg status -AT default
350 M .hgignore
350 M .hgignore
351 A added
351 A added
352 A copied
352 A copied
353 modified
353 modified
354 R removed
354 R removed
355 ! deleted
355 ! deleted
356 ? ignored
356 ? ignored
357 ? unknown
357 ? unknown
358 I ignoreddir/file
358 I ignoreddir/file
359 C modified
359 C modified
360 $ hg status -T compact
360 $ hg status -T compact
361 abort: "status" not in template map
361 abort: "status" not in template map
362 [255]
362 [255]
363
363
364 hg status ignoreddir/file:
364 hg status ignoreddir/file:
365
365
366 $ hg status ignoreddir/file
366 $ hg status ignoreddir/file
367
367
368 hg status -i ignoreddir/file:
368 hg status -i ignoreddir/file:
369
369
370 $ hg status -i ignoreddir/file
370 $ hg status -i ignoreddir/file
371 I ignoreddir/file
371 I ignoreddir/file
372 $ cd ..
372 $ cd ..
373
373
374 Check 'status -q' and some combinations
374 Check 'status -q' and some combinations
375
375
376 $ hg init repo3
376 $ hg init repo3
377 $ cd repo3
377 $ cd repo3
378 $ touch modified removed deleted ignored
378 $ touch modified removed deleted ignored
379 $ echo "^ignored$" > .hgignore
379 $ echo "^ignored$" > .hgignore
380 $ hg commit -A -m 'initial checkin'
380 $ hg commit -A -m 'initial checkin'
381 adding .hgignore
381 adding .hgignore
382 adding deleted
382 adding deleted
383 adding modified
383 adding modified
384 adding removed
384 adding removed
385 $ touch added unknown ignored
385 $ touch added unknown ignored
386 $ hg add added
386 $ hg add added
387 $ echo "test" >> modified
387 $ echo "test" >> modified
388 $ hg remove removed
388 $ hg remove removed
389 $ rm deleted
389 $ rm deleted
390 $ hg copy modified copied
390 $ hg copy modified copied
391
391
392 Specify working directory revision explicitly, that should be the same as
392 Specify working directory revision explicitly, that should be the same as
393 "hg status"
393 "hg status"
394
394
395 $ hg status --change "wdir()"
395 $ hg status --change "wdir()"
396 M modified
396 M modified
397 A added
397 A added
398 A copied
398 A copied
399 R removed
399 R removed
400 ! deleted
400 ! deleted
401 ? unknown
401 ? unknown
402
402
403 Run status with 2 different flags.
403 Run status with 2 different flags.
404 Check if result is the same or different.
404 Check if result is the same or different.
405 If result is not as expected, raise error
405 If result is not as expected, raise error
406
406
407 $ assert() {
407 $ assert() {
408 > hg status $1 > ../a
408 > hg status $1 > ../a
409 > hg status $2 > ../b
409 > hg status $2 > ../b
410 > if diff ../a ../b > /dev/null; then
410 > if diff ../a ../b > /dev/null; then
411 > out=0
411 > out=0
412 > else
412 > else
413 > out=1
413 > out=1
414 > fi
414 > fi
415 > if [ $3 -eq 0 ]; then
415 > if [ $3 -eq 0 ]; then
416 > df="same"
416 > df="same"
417 > else
417 > else
418 > df="different"
418 > df="different"
419 > fi
419 > fi
420 > if [ $out -ne $3 ]; then
420 > if [ $out -ne $3 ]; then
421 > echo "Error on $1 and $2, should be $df."
421 > echo "Error on $1 and $2, should be $df."
422 > fi
422 > fi
423 > }
423 > }
424
424
425 Assert flag1 flag2 [0-same | 1-different]
425 Assert flag1 flag2 [0-same | 1-different]
426
426
427 $ assert "-q" "-mard" 0
427 $ assert "-q" "-mard" 0
428 $ assert "-A" "-marduicC" 0
428 $ assert "-A" "-marduicC" 0
429 $ assert "-qA" "-mardcC" 0
429 $ assert "-qA" "-mardcC" 0
430 $ assert "-qAui" "-A" 0
430 $ assert "-qAui" "-A" 0
431 $ assert "-qAu" "-marducC" 0
431 $ assert "-qAu" "-marducC" 0
432 $ assert "-qAi" "-mardicC" 0
432 $ assert "-qAi" "-mardicC" 0
433 $ assert "-qu" "-u" 0
433 $ assert "-qu" "-u" 0
434 $ assert "-q" "-u" 1
434 $ assert "-q" "-u" 1
435 $ assert "-m" "-a" 1
435 $ assert "-m" "-a" 1
436 $ assert "-r" "-d" 1
436 $ assert "-r" "-d" 1
437 $ cd ..
437 $ cd ..
438
438
439 $ hg init repo4
439 $ hg init repo4
440 $ cd repo4
440 $ cd repo4
441 $ touch modified removed deleted
441 $ touch modified removed deleted
442 $ hg ci -q -A -m 'initial checkin'
442 $ hg ci -q -A -m 'initial checkin'
443 $ touch added unknown
443 $ touch added unknown
444 $ hg add added
444 $ hg add added
445 $ hg remove removed
445 $ hg remove removed
446 $ rm deleted
446 $ rm deleted
447 $ echo x > modified
447 $ echo x > modified
448 $ hg copy modified copied
448 $ hg copy modified copied
449 $ hg ci -m 'test checkin' -d "1000001 0"
449 $ hg ci -m 'test checkin' -d "1000001 0"
450 $ rm *
450 $ rm *
451 $ touch unrelated
451 $ touch unrelated
452 $ hg ci -q -A -m 'unrelated checkin' -d "1000002 0"
452 $ hg ci -q -A -m 'unrelated checkin' -d "1000002 0"
453
453
454 hg status --change 1:
454 hg status --change 1:
455
455
456 $ hg status --change 1
456 $ hg status --change 1
457 M modified
457 M modified
458 A added
458 A added
459 A copied
459 A copied
460 R removed
460 R removed
461
461
462 hg status --change 1 unrelated:
462 hg status --change 1 unrelated:
463
463
464 $ hg status --change 1 unrelated
464 $ hg status --change 1 unrelated
465
465
466 hg status -C --change 1 added modified copied removed deleted:
466 hg status -C --change 1 added modified copied removed deleted:
467
467
468 $ hg status -C --change 1 added modified copied removed deleted
468 $ hg status -C --change 1 added modified copied removed deleted
469 M modified
469 M modified
470 A added
470 A added
471 A copied
471 A copied
472 modified
472 modified
473 R removed
473 R removed
474
474
475 hg status -A --change 1 and revset:
475 hg status -A --change 1 and revset:
476
476
477 $ hg status -A --change '1|1'
477 $ hg status -A --change '1|1'
478 M modified
478 M modified
479 A added
479 A added
480 A copied
480 A copied
481 modified
481 modified
482 R removed
482 R removed
483 C deleted
483 C deleted
484
484
485 $ cd ..
485 $ cd ..
486
486
487 hg status with --rev and reverted changes:
487 hg status with --rev and reverted changes:
488
488
489 $ hg init reverted-changes-repo
489 $ hg init reverted-changes-repo
490 $ cd reverted-changes-repo
490 $ cd reverted-changes-repo
491 $ echo a > file
491 $ echo a > file
492 $ hg add file
492 $ hg add file
493 $ hg ci -m a
493 $ hg ci -m a
494 $ echo b > file
494 $ echo b > file
495 $ hg ci -m b
495 $ hg ci -m b
496
496
497 reverted file should appear clean
497 reverted file should appear clean
498
498
499 $ hg revert -r 0 .
499 $ hg revert -r 0 .
500 reverting file
500 reverting file
501 $ hg status -A --rev 0
501 $ hg status -A --rev 0
502 C file
502 C file
503
503
504 #if execbit
504 #if execbit
505 reverted file with changed flag should appear modified
505 reverted file with changed flag should appear modified
506
506
507 $ chmod +x file
507 $ chmod +x file
508 $ hg status -A --rev 0
508 $ hg status -A --rev 0
509 M file
509 M file
510
510
511 $ hg revert -r 0 .
511 $ hg revert -r 0 .
512 reverting file
512 reverting file
513
513
514 reverted and committed file with changed flag should appear modified
514 reverted and committed file with changed flag should appear modified
515
515
516 $ hg co -C .
516 $ hg co -C .
517 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
517 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
518 $ chmod +x file
518 $ chmod +x file
519 $ hg ci -m 'change flag'
519 $ hg ci -m 'change flag'
520 $ hg status -A --rev 1 --rev 2
520 $ hg status -A --rev 1 --rev 2
521 M file
521 M file
522 $ hg diff -r 1 -r 2
522 $ hg diff -r 1 -r 2
523
523
524 #endif
524 #endif
525
525
526 $ cd ..
526 $ cd ..
527
527
528 hg status of binary file starting with '\1\n', a separator for metadata:
528 hg status of binary file starting with '\1\n', a separator for metadata:
529
529
530 $ hg init repo5
530 $ hg init repo5
531 $ cd repo5
531 $ cd repo5
532 >>> open("010a", r"wb").write(b"\1\nfoo") and None
532 >>> open("010a", r"wb").write(b"\1\nfoo") and None
533 $ hg ci -q -A -m 'initial checkin'
533 $ hg ci -q -A -m 'initial checkin'
534 $ hg status -A
534 $ hg status -A
535 C 010a
535 C 010a
536
536
537 >>> open("010a", r"wb").write(b"\1\nbar") and None
537 >>> open("010a", r"wb").write(b"\1\nbar") and None
538 $ hg status -A
538 $ hg status -A
539 M 010a
539 M 010a
540 $ hg ci -q -m 'modify 010a'
540 $ hg ci -q -m 'modify 010a'
541 $ hg status -A --rev 0:1
541 $ hg status -A --rev 0:1
542 M 010a
542 M 010a
543
543
544 $ touch empty
544 $ touch empty
545 $ hg ci -q -A -m 'add another file'
545 $ hg ci -q -A -m 'add another file'
546 $ hg status -A --rev 1:2 010a
546 $ hg status -A --rev 1:2 010a
547 C 010a
547 C 010a
548
548
549 $ cd ..
549 $ cd ..
550
550
551 test "hg status" with "directory pattern" which matches against files
551 test "hg status" with "directory pattern" which matches against files
552 only known on target revision.
552 only known on target revision.
553
553
554 $ hg init repo6
554 $ hg init repo6
555 $ cd repo6
555 $ cd repo6
556
556
557 $ echo a > a.txt
557 $ echo a > a.txt
558 $ hg add a.txt
558 $ hg add a.txt
559 $ hg commit -m '#0'
559 $ hg commit -m '#0'
560 $ mkdir -p 1/2/3/4/5
560 $ mkdir -p 1/2/3/4/5
561 $ echo b > 1/2/3/4/5/b.txt
561 $ echo b > 1/2/3/4/5/b.txt
562 $ hg add 1/2/3/4/5/b.txt
562 $ hg add 1/2/3/4/5/b.txt
563 $ hg commit -m '#1'
563 $ hg commit -m '#1'
564
564
565 $ hg update -C 0 > /dev/null
565 $ hg update -C 0 > /dev/null
566 $ hg status -A
566 $ hg status -A
567 C a.txt
567 C a.txt
568
568
569 the directory matching against specified pattern should be removed,
569 the directory matching against specified pattern should be removed,
570 because directory existence prevents 'dirstate.walk()' from showing
570 because directory existence prevents 'dirstate.walk()' from showing
571 warning message about such pattern.
571 warning message about such pattern.
572
572
573 $ test ! -d 1
573 $ test ! -d 1
574 $ hg status -A --rev 1 1/2/3/4/5/b.txt
574 $ hg status -A --rev 1 1/2/3/4/5/b.txt
575 R 1/2/3/4/5/b.txt
575 R 1/2/3/4/5/b.txt
576 $ hg status -A --rev 1 1/2/3/4/5
576 $ hg status -A --rev 1 1/2/3/4/5
577 R 1/2/3/4/5/b.txt
577 R 1/2/3/4/5/b.txt
578 $ hg status -A --rev 1 1/2/3
578 $ hg status -A --rev 1 1/2/3
579 R 1/2/3/4/5/b.txt
579 R 1/2/3/4/5/b.txt
580 $ hg status -A --rev 1 1
580 $ hg status -A --rev 1 1
581 R 1/2/3/4/5/b.txt
581 R 1/2/3/4/5/b.txt
582
582
583 $ hg status --config ui.formatdebug=True --rev 1 1
583 $ hg status --config ui.formatdebug=True --rev 1 1
584 status = [
584 status = [
585 {
585 {
586 'itemtype': 'file',
586 'itemtype': 'file',
587 'path': '1/2/3/4/5/b.txt',
587 'path': '1/2/3/4/5/b.txt',
588 'status': 'R'
588 'status': 'R'
589 },
589 },
590 ]
590 ]
591
591
592 #if windows
592 #if windows
593 $ hg --config ui.slash=false status -A --rev 1 1
593 $ hg --config ui.slash=false status -A --rev 1 1
594 R 1\2\3\4\5\b.txt
594 R 1\2\3\4\5\b.txt
595 #endif
595 #endif
596
596
597 $ cd ..
597 $ cd ..
598
598
599 Status after move overwriting a file (issue4458)
599 Status after move overwriting a file (issue4458)
600 =================================================
600 =================================================
601
601
602
602
603 $ hg init issue4458
603 $ hg init issue4458
604 $ cd issue4458
604 $ cd issue4458
605 $ echo a > a
605 $ echo a > a
606 $ echo b > b
606 $ echo b > b
607 $ hg commit -Am base
607 $ hg commit -Am base
608 adding a
608 adding a
609 adding b
609 adding b
610
610
611
611
612 with --force
612 with --force
613
613
614 $ hg mv b --force a
614 $ hg mv b --force a
615 $ hg st --copies
615 $ hg st --copies
616 M a
616 M a
617 b
617 b
618 R b
618 R b
619 $ hg revert --all
619 $ hg revert --all
620 reverting a
620 reverting a
621 undeleting b
621 undeleting b
622 $ rm *.orig
622 $ rm *.orig
623
623
624 without force
624 without force
625
625
626 $ hg rm a
626 $ hg rm a
627 $ hg st --copies
627 $ hg st --copies
628 R a
628 R a
629 $ hg mv b a
629 $ hg mv b a
630 $ hg st --copies
630 $ hg st --copies
631 M a
631 M a
632 b
632 b
633 R b
633 R b
634
634
635 using ui.statuscopies setting
635 using ui.statuscopies setting
636 $ hg st --config ui.statuscopies=true
636 $ hg st --config ui.statuscopies=true
637 M a
637 M a
638 b
638 b
639 R b
639 R b
640 $ hg st --config ui.statuscopies=true --no-copies
640 $ hg st --config ui.statuscopies=true --no-copies
641 M a
641 M a
642 R b
642 R b
643 $ hg st --config ui.statuscopies=false
643 $ hg st --config ui.statuscopies=false
644 M a
644 M a
645 R b
645 R b
646 $ hg st --config ui.statuscopies=false --copies
646 $ hg st --config ui.statuscopies=false --copies
647 M a
647 M a
648 b
648 b
649 R b
649 R b
650 $ hg st --config ui.tweakdefaults=yes
650 $ hg st --config ui.tweakdefaults=yes
651 M a
651 M a
652 b
652 b
653 R b
653 R b
654
654
655 using log status template (issue5155)
655 using log status template (issue5155)
656 $ hg log -Tstatus -r 'wdir()' -C
656 $ hg log -Tstatus -r 'wdir()' -C
657 changeset: 2147483647:ffffffffffff
657 changeset: 2147483647:ffffffffffff
658 parent: 0:8c55c58b4c0e
658 parent: 0:8c55c58b4c0e
659 user: test
659 user: test
660 date: * (glob)
660 date: * (glob)
661 files:
661 files:
662 M a
662 M a
663 b
663 b
664 R b
664 R b
665
665
666 $ hg log -GTstatus -r 'wdir()' -C
666 $ hg log -GTstatus -r 'wdir()' -C
667 o changeset: 2147483647:ffffffffffff
667 o changeset: 2147483647:ffffffffffff
668 | parent: 0:8c55c58b4c0e
668 | parent: 0:8c55c58b4c0e
669 ~ user: test
669 ~ user: test
670 date: * (glob)
670 date: * (glob)
671 files:
671 files:
672 M a
672 M a
673 b
673 b
674 R b
674 R b
675
675
676
676
677 Other "bug" highlight, the revision status does not report the copy information.
677 Other "bug" highlight, the revision status does not report the copy information.
678 This is buggy behavior.
678 This is buggy behavior.
679
679
680 $ hg commit -m 'blah'
680 $ hg commit -m 'blah'
681 $ hg st --copies --change .
681 $ hg st --copies --change .
682 M a
682 M a
683 R b
683 R b
684
684
685 using log status template, the copy information is displayed correctly.
685 using log status template, the copy information is displayed correctly.
686 $ hg log -Tstatus -r. -C
686 $ hg log -Tstatus -r. -C
687 changeset: 1:6685fde43d21
687 changeset: 1:6685fde43d21
688 tag: tip
688 tag: tip
689 user: test
689 user: test
690 date: * (glob)
690 date: * (glob)
691 summary: blah
691 summary: blah
692 files:
692 files:
693 M a
693 M a
694 b
694 b
695 R b
695 R b
696
696
697
697
698 $ cd ..
698 $ cd ..
699
699
700 Make sure .hg doesn't show up even as a symlink
700 Make sure .hg doesn't show up even as a symlink
701
701
702 $ hg init repo0
702 $ hg init repo0
703 $ mkdir symlink-repo0
703 $ mkdir symlink-repo0
704 $ cd symlink-repo0
704 $ cd symlink-repo0
705 $ ln -s ../repo0/.hg
705 $ ln -s ../repo0/.hg
706 $ hg status
706 $ hg status
707
707
708 If the size hasn’t changed but mtime has, status needs to read the contents
708 If the size hasn’t changed but mtime has, status needs to read the contents
709 of the file to check whether it has changed
709 of the file to check whether it has changed
710
710
711 $ echo 1 > a
711 $ echo 1 > a
712 $ echo 1 > b
712 $ echo 1 > b
713 $ touch -t 200102030000 a b
713 $ touch -t 200102030000 a b
714 $ hg commit -Aqm '#0'
714 $ hg commit -Aqm '#0'
715 $ echo 2 > a
715 $ echo 2 > a
716 $ touch -t 200102040000 a b
716 $ touch -t 200102040000 a b
717 $ hg status
717 $ hg status
718 M a
718 M a
719
719
720 Asking specifically for the status of a deleted/removed file
720 Asking specifically for the status of a deleted/removed file
721
721
722 $ rm a
722 $ rm a
723 $ rm b
723 $ rm b
724 $ hg status a
724 $ hg status a
725 ! a
725 ! a
726 $ hg rm a
726 $ hg rm a
727 $ hg rm b
727 $ hg rm b
728 $ hg status a
728 $ hg status a
729 R a
729 R a
730 $ hg commit -qm '#1'
730 $ hg commit -qm '#1'
731 $ hg status a
731 $ hg status a
732 a: $ENOENT$
732 a: $ENOENT$
733
733
734 Check using include flag with pattern when status does not need to traverse
734 Check using include flag with pattern when status does not need to traverse
735 the working directory (issue6483)
735 the working directory (issue6483)
736
736
737 $ cd ..
737 $ cd ..
738 $ hg init issue6483
738 $ hg init issue6483
739 $ cd issue6483
739 $ cd issue6483
740 $ touch a.py b.rs
740 $ touch a.py b.rs
741 $ hg add a.py b.rs
741 $ hg add a.py b.rs
742 $ hg st -aI "*.py"
742 $ hg st -aI "*.py"
743 A a.py
743 A a.py
744
744
745 Also check exclude pattern
745 Also check exclude pattern
746
746
747 $ hg st -aX "*.rs"
747 $ hg st -aX "*.rs"
748 A a.py
748 A a.py
749
749
750 issue6335
750 issue6335
751 When a directory containing a tracked file gets symlinked, as of 5.8
751 When a directory containing a tracked file gets symlinked, as of 5.8
752 `hg st` only gives the correct answer about clean (or deleted) files
752 `hg st` only gives the correct answer about clean (or deleted) files
753 if also listing unknowns.
753 if also listing unknowns.
754 The tree-based dirstate and status algorithm fix this:
754 The tree-based dirstate and status algorithm fix this:
755
755
756 #if symlink no-dirstate-v1 rust
756 #if symlink no-dirstate-v1 rust
757
757
758 $ cd ..
758 $ cd ..
759 $ hg init issue6335
759 $ hg init issue6335
760 $ cd issue6335
760 $ cd issue6335
761 $ mkdir foo
761 $ mkdir foo
762 $ touch foo/a
762 $ touch foo/a
763 $ hg ci -Ama
763 $ hg ci -Ama
764 adding foo/a
764 adding foo/a
765 $ mv foo bar
765 $ mv foo bar
766 $ ln -s bar foo
766 $ ln -s bar foo
767 $ hg status
767 $ hg status
768 ! foo/a
768 ! foo/a
769 ? bar/a
769 ? bar/a
770 ? foo
770 ? foo
771
771
772 $ hg status -c # incorrect output without the Rust implementation
772 $ hg status -c # incorrect output without the Rust implementation
773 $ hg status -cu
773 $ hg status -cu
774 ? bar/a
774 ? bar/a
775 ? foo
775 ? foo
776 $ hg status -d # incorrect output without the Rust implementation
776 $ hg status -d # incorrect output without the Rust implementation
777 ! foo/a
777 ! foo/a
778 $ hg status -du
778 $ hg status -du
779 ! foo/a
779 ! foo/a
780 ? bar/a
780 ? bar/a
781 ? foo
781 ? foo
782
782
783 #endif
783 #endif
784
784
785
785
786 Create a repo with files in each possible status
786 Create a repo with files in each possible status
787
787
788 $ cd ..
788 $ cd ..
789 $ hg init repo7
789 $ hg init repo7
790 $ cd repo7
790 $ cd repo7
791 $ mkdir subdir
791 $ mkdir subdir
792 $ touch clean modified deleted removed
792 $ touch clean modified deleted removed
793 $ touch subdir/clean subdir/modified subdir/deleted subdir/removed
793 $ touch subdir/clean subdir/modified subdir/deleted subdir/removed
794 $ echo ignored > .hgignore
794 $ echo ignored > .hgignore
795 $ hg ci -Aqm '#0'
795 $ hg ci -Aqm '#0'
796 $ echo 1 > modified
796 $ echo 1 > modified
797 $ echo 1 > subdir/modified
797 $ echo 1 > subdir/modified
798 $ rm deleted
798 $ rm deleted
799 $ rm subdir/deleted
799 $ rm subdir/deleted
800 $ hg rm removed
800 $ hg rm removed
801 $ hg rm subdir/removed
801 $ hg rm subdir/removed
802 $ touch unknown ignored
802 $ touch unknown ignored
803 $ touch subdir/unknown subdir/ignored
803 $ touch subdir/unknown subdir/ignored
804
804
805 Check the output
805 Check the output
806
806
807 $ hg status
807 $ hg status
808 M modified
808 M modified
809 M subdir/modified
809 M subdir/modified
810 R removed
810 R removed
811 R subdir/removed
811 R subdir/removed
812 ! deleted
812 ! deleted
813 ! subdir/deleted
813 ! subdir/deleted
814 ? subdir/unknown
814 ? subdir/unknown
815 ? unknown
815 ? unknown
816
816
817 $ hg status -mard
817 $ hg status -mard
818 M modified
818 M modified
819 M subdir/modified
819 M subdir/modified
820 R removed
820 R removed
821 R subdir/removed
821 R subdir/removed
822 ! deleted
822 ! deleted
823 ! subdir/deleted
823 ! subdir/deleted
824
824
825 $ hg status -A
825 $ hg status -A
826 M modified
826 M modified
827 M subdir/modified
827 M subdir/modified
828 R removed
828 R removed
829 R subdir/removed
829 R subdir/removed
830 ! deleted
830 ! deleted
831 ! subdir/deleted
831 ! subdir/deleted
832 ? subdir/unknown
832 ? subdir/unknown
833 ? unknown
833 ? unknown
834 I ignored
834 I ignored
835 I subdir/ignored
835 I subdir/ignored
836 C .hgignore
836 C .hgignore
837 C clean
837 C clean
838 C subdir/clean
838 C subdir/clean
839
839
840 Note: `hg status some-name` creates a patternmatcher which is not supported
840 Note: `hg status some-name` creates a patternmatcher which is not supported
841 yet by the Rust implementation of status, but includematcher is supported.
841 yet by the Rust implementation of status, but includematcher is supported.
842 --include is used below for that reason
842 --include is used below for that reason
843
843
844 #if unix-permissions
844 #if unix-permissions
845
845
846 Not having permission to read a directory that contains tracked files makes
846 Not having permission to read a directory that contains tracked files makes
847 status emit a warning then behave as if the directory was empty or removed
847 status emit a warning then behave as if the directory was empty or removed
848 entirely:
848 entirely:
849
849
850 $ chmod 0 subdir
850 $ chmod 0 subdir
851 $ hg status --include subdir
851 $ hg status --include subdir
852 subdir: Permission denied
852 subdir: Permission denied
853 R subdir/removed
853 R subdir/removed
854 ! subdir/clean
854 ! subdir/clean
855 ! subdir/deleted
855 ! subdir/deleted
856 ! subdir/modified
856 ! subdir/modified
857 $ chmod 755 subdir
857 $ chmod 755 subdir
858
858
859 #endif
859 #endif
860
860
861 Remove a directory that contains tracked files
861 Remove a directory that contains tracked files
862
862
863 $ rm -r subdir
863 $ rm -r subdir
864 $ hg status --include subdir
864 $ hg status --include subdir
865 R subdir/removed
865 R subdir/removed
866 ! subdir/clean
866 ! subdir/clean
867 ! subdir/deleted
867 ! subdir/deleted
868 ! subdir/modified
868 ! subdir/modified
869
869
870 … and replace it by a file
870 … and replace it by a file
871
871
872 $ touch subdir
872 $ touch subdir
873 $ hg status --include subdir
873 $ hg status --include subdir
874 R subdir/removed
874 R subdir/removed
875 ! subdir/clean
875 ! subdir/clean
876 ! subdir/deleted
876 ! subdir/deleted
877 ! subdir/modified
877 ! subdir/modified
878 ? subdir
878 ? subdir
879
879
880 Replaced a deleted or removed file with a directory
880 Replaced a deleted or removed file with a directory
881
881
882 $ mkdir deleted removed
882 $ mkdir deleted removed
883 $ touch deleted/1 removed/1
883 $ touch deleted/1 removed/1
884 $ hg status --include deleted --include removed
884 $ hg status --include deleted --include removed
885 R removed
885 R removed
886 ! deleted
886 ! deleted
887 ? deleted/1
887 ? deleted/1
888 ? removed/1
888 ? removed/1
889 $ hg add removed/1
889 $ hg add removed/1
890 $ hg status --include deleted --include removed
890 $ hg status --include deleted --include removed
891 A removed/1
891 A removed/1
892 R removed
892 R removed
893 ! deleted
893 ! deleted
894 ? deleted/1
894 ? deleted/1
895
895
896 Deeply nested files in an ignored directory are still listed on request
896 Deeply nested files in an ignored directory are still listed on request
897
897
898 $ echo ignored-dir >> .hgignore
898 $ echo ignored-dir >> .hgignore
899 $ mkdir ignored-dir
899 $ mkdir ignored-dir
900 $ mkdir ignored-dir/subdir
900 $ mkdir ignored-dir/subdir
901 $ touch ignored-dir/subdir/1
901 $ touch ignored-dir/subdir/1
902 $ hg status --ignored
902 $ hg status --ignored
903 I ignored
903 I ignored
904 I ignored-dir/subdir/1
904 I ignored-dir/subdir/1
905
905
906 Check using include flag while listing ignored composes correctly (issue6514)
906 Check using include flag while listing ignored composes correctly (issue6514)
907
907
908 $ cd ..
908 $ cd ..
909 $ hg init issue6514
909 $ hg init issue6514
910 $ cd issue6514
910 $ cd issue6514
911 $ mkdir ignored-folder
911 $ mkdir ignored-folder
912 $ touch A.hs B.hs C.hs ignored-folder/other.txt ignored-folder/ctest.hs
912 $ touch A.hs B.hs C.hs ignored-folder/other.txt ignored-folder/ctest.hs
913 $ cat >.hgignore <<EOF
913 $ cat >.hgignore <<EOF
914 > A.hs
914 > A.hs
915 > B.hs
915 > B.hs
916 > ignored-folder/
916 > ignored-folder/
917 > EOF
917 > EOF
918 $ hg st -i -I 're:.*\.hs$'
918 $ hg st -i -I 're:.*\.hs$'
919 I A.hs
919 I A.hs
920 I B.hs
920 I B.hs
921 I ignored-folder/ctest.hs
921 I ignored-folder/ctest.hs
922
922
923 #if rust dirstate-v2
923 #if rust dirstate-v2
924
924
925 Check read_dir caching
925 Check read_dir caching
926
926
927 $ cd ..
927 $ cd ..
928 $ hg init repo8
928 $ hg init repo8
929 $ cd repo8
929 $ cd repo8
930 $ mkdir subdir
930 $ mkdir subdir
931 $ touch subdir/a subdir/b
931 $ touch subdir/a subdir/b
932 $ hg ci -Aqm '#0'
932 $ hg ci -Aqm '#0'
933
933
934 The cached mtime is initially unset
934 The cached mtime is initially unset
935
935
936 $ hg debugdirstate --all --no-dates | grep '^ '
936 $ hg debugdirstate --all --no-dates | grep '^ '
937 0 -1 unset subdir
937 0 -1 unset subdir
938
938
939 It is still not set when there are unknown files
939 It is still not set when there are unknown files
940
940
941 $ touch subdir/unknown
941 $ touch subdir/unknown
942 $ hg status
942 $ hg status
943 ? subdir/unknown
943 ? subdir/unknown
944 $ hg debugdirstate --all --no-dates | grep '^ '
944 $ hg debugdirstate --all --no-dates | grep '^ '
945 0 -1 unset subdir
945 0 -1 unset subdir
946
946
947 Now the directory is eligible for caching, so its mtime is saved in the dirstate
947 Now the directory is eligible for caching, so its mtime is saved in the dirstate
948
948
949 $ rm subdir/unknown
949 $ rm subdir/unknown
950 $ sleep 0.1 # ensure the kernel’s internal clock for mtimes has ticked
950 $ sleep 0.1 # ensure the kernel’s internal clock for mtimes has ticked
951 $ hg status
951 $ hg status
952 $ hg debugdirstate --all --no-dates | grep '^ '
952 $ hg debugdirstate --all --no-dates | grep '^ '
953 0 -1 set subdir
953 0 -1 set subdir
954
954
955 This time the command should be ever so slightly faster since it does not need `read_dir("subdir")`
955 This time the command should be ever so slightly faster since it does not need `read_dir("subdir")`
956
956
957 $ hg status
957 $ hg status
958
958
959 Creating a new file changes the directory’s mtime, invalidating the cache
959 Creating a new file changes the directory’s mtime, invalidating the cache
960
960
961 $ touch subdir/unknown
961 $ touch subdir/unknown
962 $ hg status
962 $ hg status
963 ? subdir/unknown
963 ? subdir/unknown
964
964
965 $ rm subdir/unknown
965 $ rm subdir/unknown
966 $ hg status
966 $ hg status
967
967
968 Removing a node from the dirstate resets the cache for its parent directory
968 Removing a node from the dirstate resets the cache for its parent directory
969
969
970 $ hg forget subdir/a
970 $ hg forget subdir/a
971 $ hg debugdirstate --all --no-dates | grep '^ '
971 $ hg debugdirstate --all --no-dates | grep '^ '
972 0 -1 set subdir
972 0 -1 set subdir
973 $ hg ci -qm '#1'
973 $ hg ci -qm '#1'
974 $ hg debugdirstate --all --no-dates | grep '^ '
974 $ hg debugdirstate --all --no-dates | grep '^ '
975 0 -1 unset subdir
975 0 -1 unset subdir
976 $ hg status
976 $ hg status
977 ? subdir/a
977 ? subdir/a
978
978
979 Changing the hgignore rules makes us recompute the status (and rewrite the dirstate).
979 Changing the hgignore rules makes us recompute the status (and rewrite the dirstate).
980
980
981 $ rm subdir/a
981 $ rm subdir/a
982 $ mkdir another-subdir
982 $ mkdir another-subdir
983 $ touch another-subdir/something-else
983 $ touch another-subdir/something-else
984
984
985 $ cat > "$TESTDIR"/extra-hgignore <<EOF
985 $ cat > "$TESTTMP"/extra-hgignore <<EOF
986 > something-else
986 > something-else
987 > EOF
987 > EOF
988
988
989 $ hg status --config ui.ignore.global="$TESTDIR"/extra-hgignore
989 $ hg status --config ui.ignore.global="$TESTTMP"/extra-hgignore
990 $ hg debugdirstate --all --no-dates | grep '^ '
990 $ hg debugdirstate --all --no-dates | grep '^ '
991 0 -1 set subdir
991 0 -1 set subdir
992
992
993 $ hg status
993 $ hg status
994 ? another-subdir/something-else
994 ? another-subdir/something-else
995
995
996 One invocation of status is enough to populate the cache even if it's invalidated
996 One invocation of status is enough to populate the cache even if it's invalidated
997 in the same run.
997 in the same run.
998
998
999 $ hg debugdirstate --all --no-dates | grep '^ '
999 $ hg debugdirstate --all --no-dates | grep '^ '
1000 0 -1 set subdir
1000 0 -1 set subdir
1001
1001
1002 #endif
1002 #endif
General Comments 0
You need to be logged in to leave comments. Login now