Show More
@@ -1,972 +1,973 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 | > exp-rc-dirstate-v2=1 |
|
6 | > exp-rc-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 | >>> from __future__ import print_function |
|
318 | >>> from __future__ import print_function | |
319 | >>> from mercurial import util |
|
319 | >>> from mercurial import util | |
320 | >>> pickle = util.pickle |
|
320 | >>> pickle = util.pickle | |
321 | >>> data = sorted((x[b'status'].decode(), x[b'path'].decode()) for x in pickle.load(open("pickle", r"rb"))) |
|
321 | >>> data = sorted((x[b'status'].decode(), x[b'path'].decode()) for x in pickle.load(open("pickle", r"rb"))) | |
322 | >>> for s, p in data: print("%s %s" % (s, p)) |
|
322 | >>> for s, p in data: print("%s %s" % (s, p)) | |
323 | ! deleted |
|
323 | ! deleted | |
324 | ? pickle |
|
324 | ? pickle | |
325 | ? unknown |
|
325 | ? unknown | |
326 | A added |
|
326 | A added | |
327 | A copied |
|
327 | A copied | |
328 | C .hgignore |
|
328 | C .hgignore | |
329 | C modified |
|
329 | C modified | |
330 | I ignored |
|
330 | I ignored | |
331 | R removed |
|
331 | R removed | |
332 | $ rm pickle |
|
332 | $ rm pickle | |
333 |
|
333 | |||
334 | $ echo "^ignoreddir$" > .hgignore |
|
334 | $ echo "^ignoreddir$" > .hgignore | |
335 | $ mkdir ignoreddir |
|
335 | $ mkdir ignoreddir | |
336 | $ touch ignoreddir/file |
|
336 | $ touch ignoreddir/file | |
337 |
|
337 | |||
338 | Test templater support: |
|
338 | Test templater support: | |
339 |
|
339 | |||
340 | $ hg status -AT "[{status}]\t{if(source, '{source} -> ')}{path}\n" |
|
340 | $ hg status -AT "[{status}]\t{if(source, '{source} -> ')}{path}\n" | |
341 | [M] .hgignore |
|
341 | [M] .hgignore | |
342 | [A] added |
|
342 | [A] added | |
343 | [A] modified -> copied |
|
343 | [A] modified -> copied | |
344 | [R] removed |
|
344 | [R] removed | |
345 | [!] deleted |
|
345 | [!] deleted | |
346 | [?] ignored |
|
346 | [?] ignored | |
347 | [?] unknown |
|
347 | [?] unknown | |
348 | [I] ignoreddir/file |
|
348 | [I] ignoreddir/file | |
349 | [C] modified |
|
349 | [C] modified | |
350 | $ hg status -AT default |
|
350 | $ hg status -AT default | |
351 | M .hgignore |
|
351 | M .hgignore | |
352 | A added |
|
352 | A added | |
353 | A copied |
|
353 | A copied | |
354 | modified |
|
354 | modified | |
355 | R removed |
|
355 | R removed | |
356 | ! deleted |
|
356 | ! deleted | |
357 | ? ignored |
|
357 | ? ignored | |
358 | ? unknown |
|
358 | ? unknown | |
359 | I ignoreddir/file |
|
359 | I ignoreddir/file | |
360 | C modified |
|
360 | C modified | |
361 | $ hg status -T compact |
|
361 | $ hg status -T compact | |
362 | abort: "status" not in template map |
|
362 | abort: "status" not in template map | |
363 | [255] |
|
363 | [255] | |
364 |
|
364 | |||
365 | hg status ignoreddir/file: |
|
365 | hg status ignoreddir/file: | |
366 |
|
366 | |||
367 | $ hg status ignoreddir/file |
|
367 | $ hg status ignoreddir/file | |
368 |
|
368 | |||
369 | hg status -i ignoreddir/file: |
|
369 | hg status -i ignoreddir/file: | |
370 |
|
370 | |||
371 | $ hg status -i ignoreddir/file |
|
371 | $ hg status -i ignoreddir/file | |
372 | I ignoreddir/file |
|
372 | I ignoreddir/file | |
373 | $ cd .. |
|
373 | $ cd .. | |
374 |
|
374 | |||
375 | Check 'status -q' and some combinations |
|
375 | Check 'status -q' and some combinations | |
376 |
|
376 | |||
377 | $ hg init repo3 |
|
377 | $ hg init repo3 | |
378 | $ cd repo3 |
|
378 | $ cd repo3 | |
379 | $ touch modified removed deleted ignored |
|
379 | $ touch modified removed deleted ignored | |
380 | $ echo "^ignored$" > .hgignore |
|
380 | $ echo "^ignored$" > .hgignore | |
381 | $ hg commit -A -m 'initial checkin' |
|
381 | $ hg commit -A -m 'initial checkin' | |
382 | adding .hgignore |
|
382 | adding .hgignore | |
383 | adding deleted |
|
383 | adding deleted | |
384 | adding modified |
|
384 | adding modified | |
385 | adding removed |
|
385 | adding removed | |
386 | $ touch added unknown ignored |
|
386 | $ touch added unknown ignored | |
387 | $ hg add added |
|
387 | $ hg add added | |
388 | $ echo "test" >> modified |
|
388 | $ echo "test" >> modified | |
389 | $ hg remove removed |
|
389 | $ hg remove removed | |
390 | $ rm deleted |
|
390 | $ rm deleted | |
391 | $ hg copy modified copied |
|
391 | $ hg copy modified copied | |
392 |
|
392 | |||
393 | Specify working directory revision explicitly, that should be the same as |
|
393 | Specify working directory revision explicitly, that should be the same as | |
394 | "hg status" |
|
394 | "hg status" | |
395 |
|
395 | |||
396 | $ hg status --change "wdir()" |
|
396 | $ hg status --change "wdir()" | |
397 | M modified |
|
397 | M modified | |
398 | A added |
|
398 | A added | |
399 | A copied |
|
399 | A copied | |
400 | R removed |
|
400 | R removed | |
401 | ! deleted |
|
401 | ! deleted | |
402 | ? unknown |
|
402 | ? unknown | |
403 |
|
403 | |||
404 | Run status with 2 different flags. |
|
404 | Run status with 2 different flags. | |
405 | Check if result is the same or different. |
|
405 | Check if result is the same or different. | |
406 | If result is not as expected, raise error |
|
406 | If result is not as expected, raise error | |
407 |
|
407 | |||
408 | $ assert() { |
|
408 | $ assert() { | |
409 | > hg status $1 > ../a |
|
409 | > hg status $1 > ../a | |
410 | > hg status $2 > ../b |
|
410 | > hg status $2 > ../b | |
411 | > if diff ../a ../b > /dev/null; then |
|
411 | > if diff ../a ../b > /dev/null; then | |
412 | > out=0 |
|
412 | > out=0 | |
413 | > else |
|
413 | > else | |
414 | > out=1 |
|
414 | > out=1 | |
415 | > fi |
|
415 | > fi | |
416 | > if [ $3 -eq 0 ]; then |
|
416 | > if [ $3 -eq 0 ]; then | |
417 | > df="same" |
|
417 | > df="same" | |
418 | > else |
|
418 | > else | |
419 | > df="different" |
|
419 | > df="different" | |
420 | > fi |
|
420 | > fi | |
421 | > if [ $out -ne $3 ]; then |
|
421 | > if [ $out -ne $3 ]; then | |
422 | > echo "Error on $1 and $2, should be $df." |
|
422 | > echo "Error on $1 and $2, should be $df." | |
423 | > fi |
|
423 | > fi | |
424 | > } |
|
424 | > } | |
425 |
|
425 | |||
426 | Assert flag1 flag2 [0-same | 1-different] |
|
426 | Assert flag1 flag2 [0-same | 1-different] | |
427 |
|
427 | |||
428 | $ assert "-q" "-mard" 0 |
|
428 | $ assert "-q" "-mard" 0 | |
429 | $ assert "-A" "-marduicC" 0 |
|
429 | $ assert "-A" "-marduicC" 0 | |
430 | $ assert "-qA" "-mardcC" 0 |
|
430 | $ assert "-qA" "-mardcC" 0 | |
431 | $ assert "-qAui" "-A" 0 |
|
431 | $ assert "-qAui" "-A" 0 | |
432 | $ assert "-qAu" "-marducC" 0 |
|
432 | $ assert "-qAu" "-marducC" 0 | |
433 | $ assert "-qAi" "-mardicC" 0 |
|
433 | $ assert "-qAi" "-mardicC" 0 | |
434 | $ assert "-qu" "-u" 0 |
|
434 | $ assert "-qu" "-u" 0 | |
435 | $ assert "-q" "-u" 1 |
|
435 | $ assert "-q" "-u" 1 | |
436 | $ assert "-m" "-a" 1 |
|
436 | $ assert "-m" "-a" 1 | |
437 | $ assert "-r" "-d" 1 |
|
437 | $ assert "-r" "-d" 1 | |
438 | $ cd .. |
|
438 | $ cd .. | |
439 |
|
439 | |||
440 | $ hg init repo4 |
|
440 | $ hg init repo4 | |
441 | $ cd repo4 |
|
441 | $ cd repo4 | |
442 | $ touch modified removed deleted |
|
442 | $ touch modified removed deleted | |
443 | $ hg ci -q -A -m 'initial checkin' |
|
443 | $ hg ci -q -A -m 'initial checkin' | |
444 | $ touch added unknown |
|
444 | $ touch added unknown | |
445 | $ hg add added |
|
445 | $ hg add added | |
446 | $ hg remove removed |
|
446 | $ hg remove removed | |
447 | $ rm deleted |
|
447 | $ rm deleted | |
448 | $ echo x > modified |
|
448 | $ echo x > modified | |
449 | $ hg copy modified copied |
|
449 | $ hg copy modified copied | |
450 | $ hg ci -m 'test checkin' -d "1000001 0" |
|
450 | $ hg ci -m 'test checkin' -d "1000001 0" | |
451 | $ rm * |
|
451 | $ rm * | |
452 | $ touch unrelated |
|
452 | $ touch unrelated | |
453 | $ hg ci -q -A -m 'unrelated checkin' -d "1000002 0" |
|
453 | $ hg ci -q -A -m 'unrelated checkin' -d "1000002 0" | |
454 |
|
454 | |||
455 | hg status --change 1: |
|
455 | hg status --change 1: | |
456 |
|
456 | |||
457 | $ hg status --change 1 |
|
457 | $ hg status --change 1 | |
458 | M modified |
|
458 | M modified | |
459 | A added |
|
459 | A added | |
460 | A copied |
|
460 | A copied | |
461 | R removed |
|
461 | R removed | |
462 |
|
462 | |||
463 | hg status --change 1 unrelated: |
|
463 | hg status --change 1 unrelated: | |
464 |
|
464 | |||
465 | $ hg status --change 1 unrelated |
|
465 | $ hg status --change 1 unrelated | |
466 |
|
466 | |||
467 | hg status -C --change 1 added modified copied removed deleted: |
|
467 | hg status -C --change 1 added modified copied removed deleted: | |
468 |
|
468 | |||
469 | $ hg status -C --change 1 added modified copied removed deleted |
|
469 | $ hg status -C --change 1 added modified copied removed deleted | |
470 | M modified |
|
470 | M modified | |
471 | A added |
|
471 | A added | |
472 | A copied |
|
472 | A copied | |
473 | modified |
|
473 | modified | |
474 | R removed |
|
474 | R removed | |
475 |
|
475 | |||
476 | hg status -A --change 1 and revset: |
|
476 | hg status -A --change 1 and revset: | |
477 |
|
477 | |||
478 | $ hg status -A --change '1|1' |
|
478 | $ hg status -A --change '1|1' | |
479 | M modified |
|
479 | M modified | |
480 | A added |
|
480 | A added | |
481 | A copied |
|
481 | A copied | |
482 | modified |
|
482 | modified | |
483 | R removed |
|
483 | R removed | |
484 | C deleted |
|
484 | C deleted | |
485 |
|
485 | |||
486 | $ cd .. |
|
486 | $ cd .. | |
487 |
|
487 | |||
488 | hg status with --rev and reverted changes: |
|
488 | hg status with --rev and reverted changes: | |
489 |
|
489 | |||
490 | $ hg init reverted-changes-repo |
|
490 | $ hg init reverted-changes-repo | |
491 | $ cd reverted-changes-repo |
|
491 | $ cd reverted-changes-repo | |
492 | $ echo a > file |
|
492 | $ echo a > file | |
493 | $ hg add file |
|
493 | $ hg add file | |
494 | $ hg ci -m a |
|
494 | $ hg ci -m a | |
495 | $ echo b > file |
|
495 | $ echo b > file | |
496 | $ hg ci -m b |
|
496 | $ hg ci -m b | |
497 |
|
497 | |||
498 | reverted file should appear clean |
|
498 | reverted file should appear clean | |
499 |
|
499 | |||
500 | $ hg revert -r 0 . |
|
500 | $ hg revert -r 0 . | |
501 | reverting file |
|
501 | reverting file | |
502 | $ hg status -A --rev 0 |
|
502 | $ hg status -A --rev 0 | |
503 | C file |
|
503 | C file | |
504 |
|
504 | |||
505 | #if execbit |
|
505 | #if execbit | |
506 | reverted file with changed flag should appear modified |
|
506 | reverted file with changed flag should appear modified | |
507 |
|
507 | |||
508 | $ chmod +x file |
|
508 | $ chmod +x file | |
509 | $ hg status -A --rev 0 |
|
509 | $ hg status -A --rev 0 | |
510 | M file |
|
510 | M file | |
511 |
|
511 | |||
512 | $ hg revert -r 0 . |
|
512 | $ hg revert -r 0 . | |
513 | reverting file |
|
513 | reverting file | |
514 |
|
514 | |||
515 | reverted and committed file with changed flag should appear modified |
|
515 | reverted and committed file with changed flag should appear modified | |
516 |
|
516 | |||
517 | $ hg co -C . |
|
517 | $ hg co -C . | |
518 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
518 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
519 | $ chmod +x file |
|
519 | $ chmod +x file | |
520 | $ hg ci -m 'change flag' |
|
520 | $ hg ci -m 'change flag' | |
521 | $ hg status -A --rev 1 --rev 2 |
|
521 | $ hg status -A --rev 1 --rev 2 | |
522 | M file |
|
522 | M file | |
523 | $ hg diff -r 1 -r 2 |
|
523 | $ hg diff -r 1 -r 2 | |
524 |
|
524 | |||
525 | #endif |
|
525 | #endif | |
526 |
|
526 | |||
527 | $ cd .. |
|
527 | $ cd .. | |
528 |
|
528 | |||
529 | hg status of binary file starting with '\1\n', a separator for metadata: |
|
529 | hg status of binary file starting with '\1\n', a separator for metadata: | |
530 |
|
530 | |||
531 | $ hg init repo5 |
|
531 | $ hg init repo5 | |
532 | $ cd repo5 |
|
532 | $ cd repo5 | |
533 | >>> open("010a", r"wb").write(b"\1\nfoo") and None |
|
533 | >>> open("010a", r"wb").write(b"\1\nfoo") and None | |
534 | $ hg ci -q -A -m 'initial checkin' |
|
534 | $ hg ci -q -A -m 'initial checkin' | |
535 | $ hg status -A |
|
535 | $ hg status -A | |
536 | C 010a |
|
536 | C 010a | |
537 |
|
537 | |||
538 | >>> open("010a", r"wb").write(b"\1\nbar") and None |
|
538 | >>> open("010a", r"wb").write(b"\1\nbar") and None | |
539 | $ hg status -A |
|
539 | $ hg status -A | |
540 | M 010a |
|
540 | M 010a | |
541 | $ hg ci -q -m 'modify 010a' |
|
541 | $ hg ci -q -m 'modify 010a' | |
542 | $ hg status -A --rev 0:1 |
|
542 | $ hg status -A --rev 0:1 | |
543 | M 010a |
|
543 | M 010a | |
544 |
|
544 | |||
545 | $ touch empty |
|
545 | $ touch empty | |
546 | $ hg ci -q -A -m 'add another file' |
|
546 | $ hg ci -q -A -m 'add another file' | |
547 | $ hg status -A --rev 1:2 010a |
|
547 | $ hg status -A --rev 1:2 010a | |
548 | C 010a |
|
548 | C 010a | |
549 |
|
549 | |||
550 | $ cd .. |
|
550 | $ cd .. | |
551 |
|
551 | |||
552 | test "hg status" with "directory pattern" which matches against files |
|
552 | test "hg status" with "directory pattern" which matches against files | |
553 | only known on target revision. |
|
553 | only known on target revision. | |
554 |
|
554 | |||
555 | $ hg init repo6 |
|
555 | $ hg init repo6 | |
556 | $ cd repo6 |
|
556 | $ cd repo6 | |
557 |
|
557 | |||
558 | $ echo a > a.txt |
|
558 | $ echo a > a.txt | |
559 | $ hg add a.txt |
|
559 | $ hg add a.txt | |
560 | $ hg commit -m '#0' |
|
560 | $ hg commit -m '#0' | |
561 | $ mkdir -p 1/2/3/4/5 |
|
561 | $ mkdir -p 1/2/3/4/5 | |
562 | $ echo b > 1/2/3/4/5/b.txt |
|
562 | $ echo b > 1/2/3/4/5/b.txt | |
563 | $ hg add 1/2/3/4/5/b.txt |
|
563 | $ hg add 1/2/3/4/5/b.txt | |
564 | $ hg commit -m '#1' |
|
564 | $ hg commit -m '#1' | |
565 |
|
565 | |||
566 | $ hg update -C 0 > /dev/null |
|
566 | $ hg update -C 0 > /dev/null | |
567 | $ hg status -A |
|
567 | $ hg status -A | |
568 | C a.txt |
|
568 | C a.txt | |
569 |
|
569 | |||
570 | the directory matching against specified pattern should be removed, |
|
570 | the directory matching against specified pattern should be removed, | |
571 | because directory existence prevents 'dirstate.walk()' from showing |
|
571 | because directory existence prevents 'dirstate.walk()' from showing | |
572 | warning message about such pattern. |
|
572 | warning message about such pattern. | |
573 |
|
573 | |||
574 | $ test ! -d 1 |
|
574 | $ test ! -d 1 | |
575 | $ hg status -A --rev 1 1/2/3/4/5/b.txt |
|
575 | $ hg status -A --rev 1 1/2/3/4/5/b.txt | |
576 | R 1/2/3/4/5/b.txt |
|
576 | R 1/2/3/4/5/b.txt | |
577 | $ hg status -A --rev 1 1/2/3/4/5 |
|
577 | $ hg status -A --rev 1 1/2/3/4/5 | |
578 | R 1/2/3/4/5/b.txt |
|
578 | R 1/2/3/4/5/b.txt | |
579 | $ hg status -A --rev 1 1/2/3 |
|
579 | $ hg status -A --rev 1 1/2/3 | |
580 | R 1/2/3/4/5/b.txt |
|
580 | R 1/2/3/4/5/b.txt | |
581 | $ hg status -A --rev 1 1 |
|
581 | $ hg status -A --rev 1 1 | |
582 | R 1/2/3/4/5/b.txt |
|
582 | R 1/2/3/4/5/b.txt | |
583 |
|
583 | |||
584 | $ hg status --config ui.formatdebug=True --rev 1 1 |
|
584 | $ hg status --config ui.formatdebug=True --rev 1 1 | |
585 | status = [ |
|
585 | status = [ | |
586 | { |
|
586 | { | |
587 | 'itemtype': 'file', |
|
587 | 'itemtype': 'file', | |
588 | 'path': '1/2/3/4/5/b.txt', |
|
588 | 'path': '1/2/3/4/5/b.txt', | |
589 | 'status': 'R' |
|
589 | 'status': 'R' | |
590 | }, |
|
590 | }, | |
591 | ] |
|
591 | ] | |
592 |
|
592 | |||
593 | #if windows |
|
593 | #if windows | |
594 | $ hg --config ui.slash=false status -A --rev 1 1 |
|
594 | $ hg --config ui.slash=false status -A --rev 1 1 | |
595 | R 1\2\3\4\5\b.txt |
|
595 | R 1\2\3\4\5\b.txt | |
596 | #endif |
|
596 | #endif | |
597 |
|
597 | |||
598 | $ cd .. |
|
598 | $ cd .. | |
599 |
|
599 | |||
600 | Status after move overwriting a file (issue4458) |
|
600 | Status after move overwriting a file (issue4458) | |
601 | ================================================= |
|
601 | ================================================= | |
602 |
|
602 | |||
603 |
|
603 | |||
604 | $ hg init issue4458 |
|
604 | $ hg init issue4458 | |
605 | $ cd issue4458 |
|
605 | $ cd issue4458 | |
606 | $ echo a > a |
|
606 | $ echo a > a | |
607 | $ echo b > b |
|
607 | $ echo b > b | |
608 | $ hg commit -Am base |
|
608 | $ hg commit -Am base | |
609 | adding a |
|
609 | adding a | |
610 | adding b |
|
610 | adding b | |
611 |
|
611 | |||
612 |
|
612 | |||
613 | with --force |
|
613 | with --force | |
614 |
|
614 | |||
615 | $ hg mv b --force a |
|
615 | $ hg mv b --force a | |
616 | $ hg st --copies |
|
616 | $ hg st --copies | |
617 | M a |
|
617 | M a | |
618 | b |
|
618 | b | |
619 | R b |
|
619 | R b | |
620 | $ hg revert --all |
|
620 | $ hg revert --all | |
621 | reverting a |
|
621 | reverting a | |
622 | undeleting b |
|
622 | undeleting b | |
623 | $ rm *.orig |
|
623 | $ rm *.orig | |
624 |
|
624 | |||
625 | without force |
|
625 | without force | |
626 |
|
626 | |||
627 | $ hg rm a |
|
627 | $ hg rm a | |
628 | $ hg st --copies |
|
628 | $ hg st --copies | |
629 | R a |
|
629 | R a | |
630 | $ hg mv b a |
|
630 | $ hg mv b a | |
631 | $ hg st --copies |
|
631 | $ hg st --copies | |
632 | M a |
|
632 | M a | |
633 | b |
|
633 | b | |
634 | R b |
|
634 | R b | |
635 |
|
635 | |||
636 | using ui.statuscopies setting |
|
636 | using ui.statuscopies setting | |
637 | $ hg st --config ui.statuscopies=true |
|
637 | $ hg st --config ui.statuscopies=true | |
638 | M a |
|
638 | M a | |
639 | b |
|
639 | b | |
640 | R b |
|
640 | R b | |
641 | $ hg st --config ui.statuscopies=false |
|
641 | $ hg st --config ui.statuscopies=false | |
642 | M a |
|
642 | M a | |
643 | R b |
|
643 | R b | |
644 | $ hg st --config ui.tweakdefaults=yes |
|
644 | $ hg st --config ui.tweakdefaults=yes | |
645 | M a |
|
645 | M a | |
646 | b |
|
646 | b | |
647 | R b |
|
647 | R b | |
648 |
|
648 | |||
649 | using log status template (issue5155) |
|
649 | using log status template (issue5155) | |
650 | $ hg log -Tstatus -r 'wdir()' -C |
|
650 | $ hg log -Tstatus -r 'wdir()' -C | |
651 | changeset: 2147483647:ffffffffffff |
|
651 | changeset: 2147483647:ffffffffffff | |
652 | parent: 0:8c55c58b4c0e |
|
652 | parent: 0:8c55c58b4c0e | |
653 | user: test |
|
653 | user: test | |
654 | date: * (glob) |
|
654 | date: * (glob) | |
655 | files: |
|
655 | files: | |
656 | M a |
|
656 | M a | |
657 | b |
|
657 | b | |
658 | R b |
|
658 | R b | |
659 |
|
659 | |||
660 | $ hg log -GTstatus -r 'wdir()' -C |
|
660 | $ hg log -GTstatus -r 'wdir()' -C | |
661 | o changeset: 2147483647:ffffffffffff |
|
661 | o changeset: 2147483647:ffffffffffff | |
662 | | parent: 0:8c55c58b4c0e |
|
662 | | parent: 0:8c55c58b4c0e | |
663 | ~ user: test |
|
663 | ~ user: test | |
664 | date: * (glob) |
|
664 | date: * (glob) | |
665 | files: |
|
665 | files: | |
666 | M a |
|
666 | M a | |
667 | b |
|
667 | b | |
668 | R b |
|
668 | R b | |
669 |
|
669 | |||
670 |
|
670 | |||
671 | Other "bug" highlight, the revision status does not report the copy information. |
|
671 | Other "bug" highlight, the revision status does not report the copy information. | |
672 | This is buggy behavior. |
|
672 | This is buggy behavior. | |
673 |
|
673 | |||
674 | $ hg commit -m 'blah' |
|
674 | $ hg commit -m 'blah' | |
675 | $ hg st --copies --change . |
|
675 | $ hg st --copies --change . | |
676 | M a |
|
676 | M a | |
677 | R b |
|
677 | R b | |
678 |
|
678 | |||
679 | using log status template, the copy information is displayed correctly. |
|
679 | using log status template, the copy information is displayed correctly. | |
680 | $ hg log -Tstatus -r. -C |
|
680 | $ hg log -Tstatus -r. -C | |
681 | changeset: 1:6685fde43d21 |
|
681 | changeset: 1:6685fde43d21 | |
682 | tag: tip |
|
682 | tag: tip | |
683 | user: test |
|
683 | user: test | |
684 | date: * (glob) |
|
684 | date: * (glob) | |
685 | summary: blah |
|
685 | summary: blah | |
686 | files: |
|
686 | files: | |
687 | M a |
|
687 | M a | |
688 | b |
|
688 | b | |
689 | R b |
|
689 | R b | |
690 |
|
690 | |||
691 |
|
691 | |||
692 | $ cd .. |
|
692 | $ cd .. | |
693 |
|
693 | |||
694 | Make sure .hg doesn't show up even as a symlink |
|
694 | Make sure .hg doesn't show up even as a symlink | |
695 |
|
695 | |||
696 | $ hg init repo0 |
|
696 | $ hg init repo0 | |
697 | $ mkdir symlink-repo0 |
|
697 | $ mkdir symlink-repo0 | |
698 | $ cd symlink-repo0 |
|
698 | $ cd symlink-repo0 | |
699 | $ ln -s ../repo0/.hg |
|
699 | $ ln -s ../repo0/.hg | |
700 | $ hg status |
|
700 | $ hg status | |
701 |
|
701 | |||
702 | If the size hasn’t changed but mtime has, status needs to read the contents |
|
702 | If the size hasn’t changed but mtime has, status needs to read the contents | |
703 | of the file to check whether it has changed |
|
703 | of the file to check whether it has changed | |
704 |
|
704 | |||
705 | $ echo 1 > a |
|
705 | $ echo 1 > a | |
706 | $ echo 1 > b |
|
706 | $ echo 1 > b | |
707 | $ touch -t 200102030000 a b |
|
707 | $ touch -t 200102030000 a b | |
708 | $ hg commit -Aqm '#0' |
|
708 | $ hg commit -Aqm '#0' | |
709 | $ echo 2 > a |
|
709 | $ echo 2 > a | |
710 | $ touch -t 200102040000 a b |
|
710 | $ touch -t 200102040000 a b | |
711 | $ hg status |
|
711 | $ hg status | |
712 | M a |
|
712 | M a | |
713 |
|
713 | |||
714 | Asking specifically for the status of a deleted/removed file |
|
714 | Asking specifically for the status of a deleted/removed file | |
715 |
|
715 | |||
716 | $ rm a |
|
716 | $ rm a | |
717 | $ rm b |
|
717 | $ rm b | |
718 | $ hg status a |
|
718 | $ hg status a | |
719 | ! a |
|
719 | ! a | |
720 | $ hg rm a |
|
720 | $ hg rm a | |
721 | $ hg rm b |
|
721 | $ hg rm b | |
722 | $ hg status a |
|
722 | $ hg status a | |
723 | R a |
|
723 | R a | |
724 | $ hg commit -qm '#1' |
|
724 | $ hg commit -qm '#1' | |
725 | $ hg status a |
|
725 | $ hg status a | |
726 | a: $ENOENT$ |
|
726 | a: $ENOENT$ | |
727 |
|
727 | |||
728 | Check using include flag with pattern when status does not need to traverse |
|
728 | Check using include flag with pattern when status does not need to traverse | |
729 | the working directory (issue6483) |
|
729 | the working directory (issue6483) | |
730 |
|
730 | |||
731 | $ cd .. |
|
731 | $ cd .. | |
732 | $ hg init issue6483 |
|
732 | $ hg init issue6483 | |
733 | $ cd issue6483 |
|
733 | $ cd issue6483 | |
734 | $ touch a.py b.rs |
|
734 | $ touch a.py b.rs | |
735 | $ hg add a.py b.rs |
|
735 | $ hg add a.py b.rs | |
736 | $ hg st -aI "*.py" |
|
736 | $ hg st -aI "*.py" | |
737 | A a.py |
|
737 | A a.py | |
738 |
|
738 | |||
739 | Also check exclude pattern |
|
739 | Also check exclude pattern | |
740 |
|
740 | |||
741 | $ hg st -aX "*.rs" |
|
741 | $ hg st -aX "*.rs" | |
742 | A a.py |
|
742 | A a.py | |
743 |
|
743 | |||
744 | issue6335 |
|
744 | issue6335 | |
745 | When a directory containing a tracked file gets symlinked, as of 5.8 |
|
745 | When a directory containing a tracked file gets symlinked, as of 5.8 | |
746 | `hg st` only gives the correct answer about clean (or deleted) files |
|
746 | `hg st` only gives the correct answer about clean (or deleted) files | |
747 | if also listing unknowns. |
|
747 | if also listing unknowns. | |
748 | The tree-based dirstate and status algorithm fix this: |
|
748 | The tree-based dirstate and status algorithm fix this: | |
749 |
|
749 | |||
750 | #if symlink no-dirstate-v1 rust |
|
750 | #if symlink no-dirstate-v1 rust | |
751 |
|
751 | |||
752 | $ cd .. |
|
752 | $ cd .. | |
753 | $ hg init issue6335 |
|
753 | $ hg init issue6335 | |
754 | $ cd issue6335 |
|
754 | $ cd issue6335 | |
755 | $ mkdir foo |
|
755 | $ mkdir foo | |
756 | $ touch foo/a |
|
756 | $ touch foo/a | |
757 | $ hg ci -Ama |
|
757 | $ hg ci -Ama | |
758 | adding foo/a |
|
758 | adding foo/a | |
759 | $ mv foo bar |
|
759 | $ mv foo bar | |
760 | $ ln -s bar foo |
|
760 | $ ln -s bar foo | |
761 | $ hg status |
|
761 | $ hg status | |
762 | ! foo/a |
|
762 | ! foo/a | |
763 | ? bar/a |
|
763 | ? bar/a | |
764 | ? foo |
|
764 | ? foo | |
765 |
|
765 | |||
766 | $ hg status -c # incorrect output without the Rust implementation |
|
766 | $ hg status -c # incorrect output without the Rust implementation | |
767 | $ hg status -cu |
|
767 | $ hg status -cu | |
768 | ? bar/a |
|
768 | ? bar/a | |
769 | ? foo |
|
769 | ? foo | |
770 | $ hg status -d # incorrect output without the Rust implementation |
|
770 | $ hg status -d # incorrect output without the Rust implementation | |
771 | ! foo/a |
|
771 | ! foo/a | |
772 | $ hg status -du |
|
772 | $ hg status -du | |
773 | ! foo/a |
|
773 | ! foo/a | |
774 | ? bar/a |
|
774 | ? bar/a | |
775 | ? foo |
|
775 | ? foo | |
776 |
|
776 | |||
777 | #endif |
|
777 | #endif | |
778 |
|
778 | |||
779 |
|
779 | |||
780 | Create a repo with files in each possible status |
|
780 | Create a repo with files in each possible status | |
781 |
|
781 | |||
782 | $ cd .. |
|
782 | $ cd .. | |
783 | $ hg init repo7 |
|
783 | $ hg init repo7 | |
784 | $ cd repo7 |
|
784 | $ cd repo7 | |
785 | $ mkdir subdir |
|
785 | $ mkdir subdir | |
786 | $ touch clean modified deleted removed |
|
786 | $ touch clean modified deleted removed | |
787 | $ touch subdir/clean subdir/modified subdir/deleted subdir/removed |
|
787 | $ touch subdir/clean subdir/modified subdir/deleted subdir/removed | |
788 | $ echo ignored > .hgignore |
|
788 | $ echo ignored > .hgignore | |
789 | $ hg ci -Aqm '#0' |
|
789 | $ hg ci -Aqm '#0' | |
790 | $ echo 1 > modified |
|
790 | $ echo 1 > modified | |
791 | $ echo 1 > subdir/modified |
|
791 | $ echo 1 > subdir/modified | |
792 | $ rm deleted |
|
792 | $ rm deleted | |
793 | $ rm subdir/deleted |
|
793 | $ rm subdir/deleted | |
794 | $ hg rm removed |
|
794 | $ hg rm removed | |
795 | $ hg rm subdir/removed |
|
795 | $ hg rm subdir/removed | |
796 | $ touch unknown ignored |
|
796 | $ touch unknown ignored | |
797 | $ touch subdir/unknown subdir/ignored |
|
797 | $ touch subdir/unknown subdir/ignored | |
798 |
|
798 | |||
799 | Check the output |
|
799 | Check the output | |
800 |
|
800 | |||
801 | $ hg status |
|
801 | $ hg status | |
802 | M modified |
|
802 | M modified | |
803 | M subdir/modified |
|
803 | M subdir/modified | |
804 | R removed |
|
804 | R removed | |
805 | R subdir/removed |
|
805 | R subdir/removed | |
806 | ! deleted |
|
806 | ! deleted | |
807 | ! subdir/deleted |
|
807 | ! subdir/deleted | |
808 | ? subdir/unknown |
|
808 | ? subdir/unknown | |
809 | ? unknown |
|
809 | ? unknown | |
810 |
|
810 | |||
811 | $ hg status -mard |
|
811 | $ hg status -mard | |
812 | M modified |
|
812 | M modified | |
813 | M subdir/modified |
|
813 | M subdir/modified | |
814 | R removed |
|
814 | R removed | |
815 | R subdir/removed |
|
815 | R subdir/removed | |
816 | ! deleted |
|
816 | ! deleted | |
817 | ! subdir/deleted |
|
817 | ! subdir/deleted | |
818 |
|
818 | |||
819 | $ hg status -A |
|
819 | $ hg status -A | |
820 | M modified |
|
820 | M modified | |
821 | M subdir/modified |
|
821 | M subdir/modified | |
822 | R removed |
|
822 | R removed | |
823 | R subdir/removed |
|
823 | R subdir/removed | |
824 | ! deleted |
|
824 | ! deleted | |
825 | ! subdir/deleted |
|
825 | ! subdir/deleted | |
826 | ? subdir/unknown |
|
826 | ? subdir/unknown | |
827 | ? unknown |
|
827 | ? unknown | |
828 | I ignored |
|
828 | I ignored | |
829 | I subdir/ignored |
|
829 | I subdir/ignored | |
830 | C .hgignore |
|
830 | C .hgignore | |
831 | C clean |
|
831 | C clean | |
832 | C subdir/clean |
|
832 | C subdir/clean | |
833 |
|
833 | |||
834 | Note: `hg status some-name` creates a patternmatcher which is not supported |
|
834 | Note: `hg status some-name` creates a patternmatcher which is not supported | |
835 | yet by the Rust implementation of status, but includematcher is supported. |
|
835 | yet by the Rust implementation of status, but includematcher is supported. | |
836 | --include is used below for that reason |
|
836 | --include is used below for that reason | |
837 |
|
837 | |||
838 | #if unix-permissions |
|
838 | #if unix-permissions | |
839 |
|
839 | |||
840 | Not having permission to read a directory that contains tracked files makes |
|
840 | Not having permission to read a directory that contains tracked files makes | |
841 | status emit a warning then behave as if the directory was empty or removed |
|
841 | status emit a warning then behave as if the directory was empty or removed | |
842 | entirely: |
|
842 | entirely: | |
843 |
|
843 | |||
844 | $ chmod 0 subdir |
|
844 | $ chmod 0 subdir | |
845 | $ hg status --include subdir |
|
845 | $ hg status --include subdir | |
846 | subdir: Permission denied |
|
846 | subdir: Permission denied | |
847 | R subdir/removed |
|
847 | R subdir/removed | |
848 | ! subdir/clean |
|
848 | ! subdir/clean | |
849 | ! subdir/deleted |
|
849 | ! subdir/deleted | |
850 | ! subdir/modified |
|
850 | ! subdir/modified | |
851 | $ chmod 755 subdir |
|
851 | $ chmod 755 subdir | |
852 |
|
852 | |||
853 | #endif |
|
853 | #endif | |
854 |
|
854 | |||
855 | Remove a directory that contains tracked files |
|
855 | Remove a directory that contains tracked files | |
856 |
|
856 | |||
857 | $ rm -r subdir |
|
857 | $ rm -r subdir | |
858 | $ hg status --include subdir |
|
858 | $ hg status --include subdir | |
859 | R subdir/removed |
|
859 | R subdir/removed | |
860 | ! subdir/clean |
|
860 | ! subdir/clean | |
861 | ! subdir/deleted |
|
861 | ! subdir/deleted | |
862 | ! subdir/modified |
|
862 | ! subdir/modified | |
863 |
|
863 | |||
864 | … and replace it by a file |
|
864 | … and replace it by a file | |
865 |
|
865 | |||
866 | $ touch subdir |
|
866 | $ touch subdir | |
867 | $ hg status --include subdir |
|
867 | $ hg status --include subdir | |
868 | R subdir/removed |
|
868 | R subdir/removed | |
869 | ! subdir/clean |
|
869 | ! subdir/clean | |
870 | ! subdir/deleted |
|
870 | ! subdir/deleted | |
871 | ! subdir/modified |
|
871 | ! subdir/modified | |
872 | ? subdir |
|
872 | ? subdir | |
873 |
|
873 | |||
874 | Replaced a deleted or removed file with a directory |
|
874 | Replaced a deleted or removed file with a directory | |
875 |
|
875 | |||
876 | $ mkdir deleted removed |
|
876 | $ mkdir deleted removed | |
877 | $ touch deleted/1 removed/1 |
|
877 | $ touch deleted/1 removed/1 | |
878 | $ hg status --include deleted --include removed |
|
878 | $ hg status --include deleted --include removed | |
879 | R removed |
|
879 | R removed | |
880 | ! deleted |
|
880 | ! deleted | |
881 | ? deleted/1 |
|
881 | ? deleted/1 | |
882 | ? removed/1 |
|
882 | ? removed/1 | |
883 | $ hg add removed/1 |
|
883 | $ hg add removed/1 | |
884 | $ hg status --include deleted --include removed |
|
884 | $ hg status --include deleted --include removed | |
885 | A removed/1 |
|
885 | A removed/1 | |
886 | R removed |
|
886 | R removed | |
887 | ! deleted |
|
887 | ! deleted | |
888 | ? deleted/1 |
|
888 | ? deleted/1 | |
889 |
|
889 | |||
890 | Deeply nested files in an ignored directory are still listed on request |
|
890 | Deeply nested files in an ignored directory are still listed on request | |
891 |
|
891 | |||
892 | $ echo ignored-dir >> .hgignore |
|
892 | $ echo ignored-dir >> .hgignore | |
893 | $ mkdir ignored-dir |
|
893 | $ mkdir ignored-dir | |
894 | $ mkdir ignored-dir/subdir |
|
894 | $ mkdir ignored-dir/subdir | |
895 | $ touch ignored-dir/subdir/1 |
|
895 | $ touch ignored-dir/subdir/1 | |
896 | $ hg status --ignored |
|
896 | $ hg status --ignored | |
897 | I ignored |
|
897 | I ignored | |
898 | I ignored-dir/subdir/1 |
|
898 | I ignored-dir/subdir/1 | |
899 |
|
899 | |||
900 | Check using include flag while listing ignored composes correctly (issue6514) |
|
900 | Check using include flag while listing ignored composes correctly (issue6514) | |
901 |
|
901 | |||
902 | $ cd .. |
|
902 | $ cd .. | |
903 | $ hg init issue6514 |
|
903 | $ hg init issue6514 | |
904 | $ cd issue6514 |
|
904 | $ cd issue6514 | |
905 | $ mkdir ignored-folder |
|
905 | $ mkdir ignored-folder | |
906 | $ touch A.hs B.hs C.hs ignored-folder/other.txt ignored-folder/ctest.hs |
|
906 | $ touch A.hs B.hs C.hs ignored-folder/other.txt ignored-folder/ctest.hs | |
907 | $ cat >.hgignore <<EOF |
|
907 | $ cat >.hgignore <<EOF | |
908 | > A.hs |
|
908 | > A.hs | |
909 | > B.hs |
|
909 | > B.hs | |
910 | > ignored-folder/ |
|
910 | > ignored-folder/ | |
911 | > EOF |
|
911 | > EOF | |
912 | $ hg st -i -I 're:.*\.hs$' |
|
912 | $ hg st -i -I 're:.*\.hs$' | |
913 | I A.hs |
|
913 | I A.hs | |
914 | I B.hs |
|
914 | I B.hs | |
915 | I ignored-folder/ctest.hs |
|
915 | I ignored-folder/ctest.hs | |
916 |
|
916 | |||
917 | #if rust dirstate-v2 |
|
917 | #if rust dirstate-v2 | |
918 |
|
918 | |||
919 | Check read_dir caching |
|
919 | Check read_dir caching | |
920 |
|
920 | |||
921 | $ cd .. |
|
921 | $ cd .. | |
922 | $ hg init repo8 |
|
922 | $ hg init repo8 | |
923 | $ cd repo8 |
|
923 | $ cd repo8 | |
924 | $ mkdir subdir |
|
924 | $ mkdir subdir | |
925 | $ touch subdir/a subdir/b |
|
925 | $ touch subdir/a subdir/b | |
926 | $ hg ci -Aqm '#0' |
|
926 | $ hg ci -Aqm '#0' | |
927 |
|
927 | |||
928 | The cached mtime is initially unset |
|
928 | The cached mtime is initially unset | |
929 |
|
929 | |||
930 | $ hg debugdirstate --all --no-dates | grep '^ ' |
|
930 | $ hg debugdirstate --all --no-dates | grep '^ ' | |
931 | 0 -1 unset subdir |
|
931 | 0 -1 unset subdir | |
932 |
|
932 | |||
933 | It is still not set when there are unknown files |
|
933 | It is still not set when there are unknown files | |
934 |
|
934 | |||
935 | $ touch subdir/unknown |
|
935 | $ touch subdir/unknown | |
936 | $ hg status |
|
936 | $ hg status | |
937 | ? subdir/unknown |
|
937 | ? subdir/unknown | |
938 | $ hg debugdirstate --all --no-dates | grep '^ ' |
|
938 | $ hg debugdirstate --all --no-dates | grep '^ ' | |
939 | 0 -1 unset subdir |
|
939 | 0 -1 unset subdir | |
940 |
|
940 | |||
941 | Now the directory is eligible for caching, so its mtime is save in the dirstate |
|
941 | Now the directory is eligible for caching, so its mtime is save in the dirstate | |
942 |
|
942 | |||
943 | $ rm subdir/unknown |
|
943 | $ rm subdir/unknown | |
|
944 | $ sleep 0.1 # ensure the kernel’s internal clock for mtimes has ticked | |||
944 | $ hg status |
|
945 | $ hg status | |
945 | $ hg debugdirstate --all --no-dates | grep '^ ' |
|
946 | $ hg debugdirstate --all --no-dates | grep '^ ' | |
946 | 0 -1 set subdir |
|
947 | 0 -1 set subdir | |
947 |
|
948 | |||
948 | This time the command should be ever so slightly faster since it does not need `read_dir("subdir")` |
|
949 | This time the command should be ever so slightly faster since it does not need `read_dir("subdir")` | |
949 |
|
950 | |||
950 | $ hg status |
|
951 | $ hg status | |
951 |
|
952 | |||
952 | Creating a new file changes the directory’s mtime, invalidating the cache |
|
953 | Creating a new file changes the directory’s mtime, invalidating the cache | |
953 |
|
954 | |||
954 | $ touch subdir/unknown |
|
955 | $ touch subdir/unknown | |
955 | $ hg status |
|
956 | $ hg status | |
956 | ? subdir/unknown |
|
957 | ? subdir/unknown | |
957 |
|
958 | |||
958 | $ rm subdir/unknown |
|
959 | $ rm subdir/unknown | |
959 | $ hg status |
|
960 | $ hg status | |
960 |
|
961 | |||
961 | Removing a node from the dirstate resets the cache for its parent directory |
|
962 | Removing a node from the dirstate resets the cache for its parent directory | |
962 |
|
963 | |||
963 | $ hg forget subdir/a |
|
964 | $ hg forget subdir/a | |
964 | $ hg debugdirstate --all --no-dates | grep '^ ' |
|
965 | $ hg debugdirstate --all --no-dates | grep '^ ' | |
965 | 0 -1 set subdir |
|
966 | 0 -1 set subdir | |
966 | $ hg ci -qm '#1' |
|
967 | $ hg ci -qm '#1' | |
967 | $ hg debugdirstate --all --no-dates | grep '^ ' |
|
968 | $ hg debugdirstate --all --no-dates | grep '^ ' | |
968 | 0 -1 unset subdir |
|
969 | 0 -1 unset subdir | |
969 | $ hg status |
|
970 | $ hg status | |
970 | ? subdir/a |
|
971 | ? subdir/a | |
971 |
|
972 | |||
972 | #endif |
|
973 | #endif |
General Comments 0
You need to be logged in to leave comments.
Login now