Show More
@@ -1,613 +1,613 b'' | |||||
1 | $ hg init repo1 |
|
1 | $ hg init repo1 | |
2 | $ cd repo1 |
|
2 | $ cd repo1 | |
3 | $ mkdir a b a/1 b/1 b/2 |
|
3 | $ mkdir a b a/1 b/1 b/2 | |
4 | $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2 |
|
4 | $ touch in_root a/in_a b/in_b a/1/in_a_1 b/1/in_b_1 b/2/in_b_2 | |
5 |
|
5 | |||
6 | hg status in repo root: |
|
6 | hg status in repo root: | |
7 |
|
7 | |||
8 | $ hg status |
|
8 | $ hg status | |
9 | ? a/1/in_a_1 |
|
9 | ? a/1/in_a_1 | |
10 | ? a/in_a |
|
10 | ? a/in_a | |
11 | ? b/1/in_b_1 |
|
11 | ? b/1/in_b_1 | |
12 | ? b/2/in_b_2 |
|
12 | ? b/2/in_b_2 | |
13 | ? b/in_b |
|
13 | ? b/in_b | |
14 | ? in_root |
|
14 | ? in_root | |
15 |
|
15 | |||
16 | hg status . in repo root: |
|
16 | hg status . in repo root: | |
17 |
|
17 | |||
18 | $ hg status . |
|
18 | $ hg status . | |
19 | ? a/1/in_a_1 |
|
19 | ? a/1/in_a_1 | |
20 | ? a/in_a |
|
20 | ? a/in_a | |
21 | ? b/1/in_b_1 |
|
21 | ? b/1/in_b_1 | |
22 | ? b/2/in_b_2 |
|
22 | ? b/2/in_b_2 | |
23 | ? b/in_b |
|
23 | ? b/in_b | |
24 | ? in_root |
|
24 | ? in_root | |
25 |
|
25 | |||
26 | $ hg status --cwd a |
|
26 | $ hg status --cwd a | |
27 | ? a/1/in_a_1 |
|
27 | ? a/1/in_a_1 | |
28 | ? a/in_a |
|
28 | ? a/in_a | |
29 | ? b/1/in_b_1 |
|
29 | ? b/1/in_b_1 | |
30 | ? b/2/in_b_2 |
|
30 | ? b/2/in_b_2 | |
31 | ? b/in_b |
|
31 | ? b/in_b | |
32 | ? in_root |
|
32 | ? in_root | |
33 | $ hg status --cwd a . |
|
33 | $ hg status --cwd a . | |
34 | ? 1/in_a_1 |
|
34 | ? 1/in_a_1 | |
35 | ? in_a |
|
35 | ? in_a | |
36 | $ hg status --cwd a .. |
|
36 | $ hg status --cwd a .. | |
37 | ? 1/in_a_1 |
|
37 | ? 1/in_a_1 | |
38 | ? in_a |
|
38 | ? in_a | |
39 | ? ../b/1/in_b_1 |
|
39 | ? ../b/1/in_b_1 | |
40 | ? ../b/2/in_b_2 |
|
40 | ? ../b/2/in_b_2 | |
41 | ? ../b/in_b |
|
41 | ? ../b/in_b | |
42 | ? ../in_root |
|
42 | ? ../in_root | |
43 |
|
43 | |||
44 | $ hg status --cwd b |
|
44 | $ hg status --cwd b | |
45 | ? a/1/in_a_1 |
|
45 | ? a/1/in_a_1 | |
46 | ? a/in_a |
|
46 | ? a/in_a | |
47 | ? b/1/in_b_1 |
|
47 | ? b/1/in_b_1 | |
48 | ? b/2/in_b_2 |
|
48 | ? b/2/in_b_2 | |
49 | ? b/in_b |
|
49 | ? b/in_b | |
50 | ? in_root |
|
50 | ? in_root | |
51 | $ hg status --cwd b . |
|
51 | $ hg status --cwd b . | |
52 | ? 1/in_b_1 |
|
52 | ? 1/in_b_1 | |
53 | ? 2/in_b_2 |
|
53 | ? 2/in_b_2 | |
54 | ? in_b |
|
54 | ? in_b | |
55 | $ hg status --cwd b .. |
|
55 | $ hg status --cwd b .. | |
56 | ? ../a/1/in_a_1 |
|
56 | ? ../a/1/in_a_1 | |
57 | ? ../a/in_a |
|
57 | ? ../a/in_a | |
58 | ? 1/in_b_1 |
|
58 | ? 1/in_b_1 | |
59 | ? 2/in_b_2 |
|
59 | ? 2/in_b_2 | |
60 | ? in_b |
|
60 | ? in_b | |
61 | ? ../in_root |
|
61 | ? ../in_root | |
62 |
|
62 | |||
63 | $ hg status --cwd a/1 |
|
63 | $ hg status --cwd a/1 | |
64 | ? a/1/in_a_1 |
|
64 | ? a/1/in_a_1 | |
65 | ? a/in_a |
|
65 | ? a/in_a | |
66 | ? b/1/in_b_1 |
|
66 | ? b/1/in_b_1 | |
67 | ? b/2/in_b_2 |
|
67 | ? b/2/in_b_2 | |
68 | ? b/in_b |
|
68 | ? b/in_b | |
69 | ? in_root |
|
69 | ? in_root | |
70 | $ hg status --cwd a/1 . |
|
70 | $ hg status --cwd a/1 . | |
71 | ? in_a_1 |
|
71 | ? in_a_1 | |
72 | $ hg status --cwd a/1 .. |
|
72 | $ hg status --cwd a/1 .. | |
73 | ? in_a_1 |
|
73 | ? in_a_1 | |
74 | ? ../in_a |
|
74 | ? ../in_a | |
75 |
|
75 | |||
76 | $ hg status --cwd b/1 |
|
76 | $ hg status --cwd b/1 | |
77 | ? a/1/in_a_1 |
|
77 | ? a/1/in_a_1 | |
78 | ? a/in_a |
|
78 | ? a/in_a | |
79 | ? b/1/in_b_1 |
|
79 | ? b/1/in_b_1 | |
80 | ? b/2/in_b_2 |
|
80 | ? b/2/in_b_2 | |
81 | ? b/in_b |
|
81 | ? b/in_b | |
82 | ? in_root |
|
82 | ? in_root | |
83 | $ hg status --cwd b/1 . |
|
83 | $ hg status --cwd b/1 . | |
84 | ? in_b_1 |
|
84 | ? in_b_1 | |
85 | $ hg status --cwd b/1 .. |
|
85 | $ hg status --cwd b/1 .. | |
86 | ? in_b_1 |
|
86 | ? in_b_1 | |
87 | ? ../2/in_b_2 |
|
87 | ? ../2/in_b_2 | |
88 | ? ../in_b |
|
88 | ? ../in_b | |
89 |
|
89 | |||
90 | $ hg status --cwd b/2 |
|
90 | $ hg status --cwd b/2 | |
91 | ? a/1/in_a_1 |
|
91 | ? a/1/in_a_1 | |
92 | ? a/in_a |
|
92 | ? a/in_a | |
93 | ? b/1/in_b_1 |
|
93 | ? b/1/in_b_1 | |
94 | ? b/2/in_b_2 |
|
94 | ? b/2/in_b_2 | |
95 | ? b/in_b |
|
95 | ? b/in_b | |
96 | ? in_root |
|
96 | ? in_root | |
97 | $ hg status --cwd b/2 . |
|
97 | $ hg status --cwd b/2 . | |
98 | ? in_b_2 |
|
98 | ? in_b_2 | |
99 | $ hg status --cwd b/2 .. |
|
99 | $ hg status --cwd b/2 .. | |
100 | ? ../1/in_b_1 |
|
100 | ? ../1/in_b_1 | |
101 | ? in_b_2 |
|
101 | ? in_b_2 | |
102 | ? ../in_b |
|
102 | ? ../in_b | |
103 |
|
103 | |||
104 | combining patterns with root and patterns without a root works |
|
104 | combining patterns with root and patterns without a root works | |
105 |
|
105 | |||
106 | $ hg st a/in_a re:.*b$ |
|
106 | $ hg st a/in_a re:.*b$ | |
107 | ? a/in_a |
|
107 | ? a/in_a | |
108 | ? b/in_b |
|
108 | ? b/in_b | |
109 |
|
109 | |||
110 | tweaking defaults works |
|
110 | tweaking defaults works | |
111 | $ hg status --cwd a --config ui.tweakdefaults=yes |
|
111 | $ hg status --cwd a --config ui.tweakdefaults=yes | |
112 | ? 1/in_a_1 |
|
112 | ? 1/in_a_1 | |
113 | ? in_a |
|
113 | ? in_a | |
114 | ? ../b/1/in_b_1 |
|
114 | ? ../b/1/in_b_1 | |
115 | ? ../b/2/in_b_2 |
|
115 | ? ../b/2/in_b_2 | |
116 | ? ../b/in_b |
|
116 | ? ../b/in_b | |
117 | ? ../in_root |
|
117 | ? ../in_root | |
118 | $ HGPLAIN=1 hg status --cwd a --config ui.tweakdefaults=yes |
|
118 | $ HGPLAIN=1 hg status --cwd a --config ui.tweakdefaults=yes | |
119 | ? a/1/in_a_1 (glob) |
|
119 | ? a/1/in_a_1 (glob) | |
120 | ? a/in_a (glob) |
|
120 | ? a/in_a (glob) | |
121 | ? b/1/in_b_1 (glob) |
|
121 | ? b/1/in_b_1 (glob) | |
122 | ? b/2/in_b_2 (glob) |
|
122 | ? b/2/in_b_2 (glob) | |
123 | ? b/in_b (glob) |
|
123 | ? b/in_b (glob) | |
124 | ? in_root |
|
124 | ? in_root | |
125 | $ HGPLAINEXCEPT=tweakdefaults hg status --cwd a --config ui.tweakdefaults=yes |
|
125 | $ HGPLAINEXCEPT=tweakdefaults hg status --cwd a --config ui.tweakdefaults=yes | |
126 | ? 1/in_a_1 (glob) |
|
126 | ? 1/in_a_1 (glob) | |
127 | ? in_a |
|
127 | ? in_a | |
128 | ? ../b/1/in_b_1 (glob) |
|
128 | ? ../b/1/in_b_1 (glob) | |
129 | ? ../b/2/in_b_2 (glob) |
|
129 | ? ../b/2/in_b_2 (glob) | |
130 | ? ../b/in_b (glob) |
|
130 | ? ../b/in_b (glob) | |
131 | ? ../in_root (glob) |
|
131 | ? ../in_root (glob) | |
132 |
|
132 | |||
133 | relative paths can be requested |
|
133 | relative paths can be requested | |
134 |
|
134 | |||
135 | $ cat >> $HGRCPATH <<EOF |
|
135 | $ cat >> $HGRCPATH <<EOF | |
136 | > [commands] |
|
136 | > [commands] | |
137 | > status.relative = True |
|
137 | > status.relative = True | |
138 | > EOF |
|
138 | > EOF | |
139 | $ hg status --cwd a |
|
139 | $ hg status --cwd a | |
140 | ? 1/in_a_1 |
|
140 | ? 1/in_a_1 | |
141 | ? in_a |
|
141 | ? in_a | |
142 | ? ../b/1/in_b_1 |
|
142 | ? ../b/1/in_b_1 | |
143 | ? ../b/2/in_b_2 |
|
143 | ? ../b/2/in_b_2 | |
144 | ? ../b/in_b |
|
144 | ? ../b/in_b | |
145 | ? ../in_root |
|
145 | ? ../in_root | |
146 | $ HGPLAIN=1 hg status --cwd a |
|
146 | $ HGPLAIN=1 hg status --cwd a | |
147 | ? a/1/in_a_1 (glob) |
|
147 | ? a/1/in_a_1 (glob) | |
148 | ? a/in_a (glob) |
|
148 | ? a/in_a (glob) | |
149 | ? b/1/in_b_1 (glob) |
|
149 | ? b/1/in_b_1 (glob) | |
150 | ? b/2/in_b_2 (glob) |
|
150 | ? b/2/in_b_2 (glob) | |
151 | ? b/in_b (glob) |
|
151 | ? b/in_b (glob) | |
152 | ? in_root |
|
152 | ? in_root | |
153 |
|
153 | |||
154 | if relative paths are explicitly off, tweakdefaults doesn't change it |
|
154 | if relative paths are explicitly off, tweakdefaults doesn't change it | |
155 | $ cat >> $HGRCPATH <<EOF |
|
155 | $ cat >> $HGRCPATH <<EOF | |
156 | > [commands] |
|
156 | > [commands] | |
157 | > status.relative = False |
|
157 | > status.relative = False | |
158 | > EOF |
|
158 | > EOF | |
159 | $ hg status --cwd a --config ui.tweakdefaults=yes |
|
159 | $ hg status --cwd a --config ui.tweakdefaults=yes | |
160 | ? a/1/in_a_1 |
|
160 | ? a/1/in_a_1 | |
161 | ? a/in_a |
|
161 | ? a/in_a | |
162 | ? b/1/in_b_1 |
|
162 | ? b/1/in_b_1 | |
163 | ? b/2/in_b_2 |
|
163 | ? b/2/in_b_2 | |
164 | ? b/in_b |
|
164 | ? b/in_b | |
165 | ? in_root |
|
165 | ? in_root | |
166 |
|
166 | |||
167 | $ cd .. |
|
167 | $ cd .. | |
168 |
|
168 | |||
169 | $ hg init repo2 |
|
169 | $ hg init repo2 | |
170 | $ cd repo2 |
|
170 | $ cd repo2 | |
171 | $ touch modified removed deleted ignored |
|
171 | $ touch modified removed deleted ignored | |
172 | $ echo "^ignored$" > .hgignore |
|
172 | $ echo "^ignored$" > .hgignore | |
173 | $ hg ci -A -m 'initial checkin' |
|
173 | $ hg ci -A -m 'initial checkin' | |
174 | adding .hgignore |
|
174 | adding .hgignore | |
175 | adding deleted |
|
175 | adding deleted | |
176 | adding modified |
|
176 | adding modified | |
177 | adding removed |
|
177 | adding removed | |
178 | $ touch modified added unknown ignored |
|
178 | $ touch modified added unknown ignored | |
179 | $ hg add added |
|
179 | $ hg add added | |
180 | $ hg remove removed |
|
180 | $ hg remove removed | |
181 | $ rm deleted |
|
181 | $ rm deleted | |
182 |
|
182 | |||
183 | hg status: |
|
183 | hg status: | |
184 |
|
184 | |||
185 | $ hg status |
|
185 | $ hg status | |
186 | A added |
|
186 | A added | |
187 | R removed |
|
187 | R removed | |
188 | ! deleted |
|
188 | ! deleted | |
189 | ? unknown |
|
189 | ? unknown | |
190 |
|
190 | |||
191 | hg status modified added removed deleted unknown never-existed ignored: |
|
191 | hg status modified added removed deleted unknown never-existed ignored: | |
192 |
|
192 | |||
193 | $ hg status modified added removed deleted unknown never-existed ignored |
|
193 | $ hg status modified added removed deleted unknown never-existed ignored | |
194 | never-existed: * (glob) |
|
194 | never-existed: * (glob) | |
195 | A added |
|
195 | A added | |
196 | R removed |
|
196 | R removed | |
197 | ! deleted |
|
197 | ! deleted | |
198 | ? unknown |
|
198 | ? unknown | |
199 |
|
199 | |||
200 | $ hg copy modified copied |
|
200 | $ hg copy modified copied | |
201 |
|
201 | |||
202 | hg status -C: |
|
202 | hg status -C: | |
203 |
|
203 | |||
204 | $ hg status -C |
|
204 | $ hg status -C | |
205 | A added |
|
205 | A added | |
206 | A copied |
|
206 | A copied | |
207 | modified |
|
207 | modified | |
208 | R removed |
|
208 | R removed | |
209 | ! deleted |
|
209 | ! deleted | |
210 | ? unknown |
|
210 | ? unknown | |
211 |
|
211 | |||
212 | hg status -A: |
|
212 | hg status -A: | |
213 |
|
213 | |||
214 | $ hg status -A |
|
214 | $ hg status -A | |
215 | A added |
|
215 | A added | |
216 | A copied |
|
216 | A copied | |
217 | modified |
|
217 | modified | |
218 | R removed |
|
218 | R removed | |
219 | ! deleted |
|
219 | ! deleted | |
220 | ? unknown |
|
220 | ? unknown | |
221 | I ignored |
|
221 | I ignored | |
222 | C .hgignore |
|
222 | C .hgignore | |
223 | C modified |
|
223 | C modified | |
224 |
|
224 | |||
225 | $ hg status -A -Tjson |
|
225 | $ hg status -A -Tjson | |
226 | [ |
|
226 | [ | |
227 | { |
|
227 | { | |
228 | "path": "added", |
|
228 | "path": "added", | |
229 | "status": "A" |
|
229 | "status": "A" | |
230 | }, |
|
230 | }, | |
231 | { |
|
231 | { | |
232 | "copy": "modified", |
|
232 | "copy": "modified", | |
233 | "path": "copied", |
|
233 | "path": "copied", | |
234 | "status": "A" |
|
234 | "status": "A" | |
235 | }, |
|
235 | }, | |
236 | { |
|
236 | { | |
237 | "path": "removed", |
|
237 | "path": "removed", | |
238 | "status": "R" |
|
238 | "status": "R" | |
239 | }, |
|
239 | }, | |
240 | { |
|
240 | { | |
241 | "path": "deleted", |
|
241 | "path": "deleted", | |
242 | "status": "!" |
|
242 | "status": "!" | |
243 | }, |
|
243 | }, | |
244 | { |
|
244 | { | |
245 | "path": "unknown", |
|
245 | "path": "unknown", | |
246 | "status": "?" |
|
246 | "status": "?" | |
247 | }, |
|
247 | }, | |
248 | { |
|
248 | { | |
249 | "path": "ignored", |
|
249 | "path": "ignored", | |
250 | "status": "I" |
|
250 | "status": "I" | |
251 | }, |
|
251 | }, | |
252 | { |
|
252 | { | |
253 | "path": ".hgignore", |
|
253 | "path": ".hgignore", | |
254 | "status": "C" |
|
254 | "status": "C" | |
255 | }, |
|
255 | }, | |
256 | { |
|
256 | { | |
257 | "path": "modified", |
|
257 | "path": "modified", | |
258 | "status": "C" |
|
258 | "status": "C" | |
259 | } |
|
259 | } | |
260 | ] |
|
260 | ] | |
261 |
|
261 | |||
262 | $ hg status -A -Tpickle > pickle |
|
262 | $ hg status -A -Tpickle > pickle | |
263 | >>> from __future__ import print_function |
|
263 | >>> from __future__ import print_function | |
264 | >>> import pickle |
|
264 | >>> import pickle | |
265 | >>> print(sorted((x['status'], x['path']) for x in pickle.load(open("pickle")))) |
|
265 | >>> print(sorted((x['status'], x['path']) for x in pickle.load(open("pickle")))) | |
266 | [('!', 'deleted'), ('?', 'pickle'), ('?', 'unknown'), ('A', 'added'), ('A', 'copied'), ('C', '.hgignore'), ('C', 'modified'), ('I', 'ignored'), ('R', 'removed')] |
|
266 | [('!', 'deleted'), ('?', 'pickle'), ('?', 'unknown'), ('A', 'added'), ('A', 'copied'), ('C', '.hgignore'), ('C', 'modified'), ('I', 'ignored'), ('R', 'removed')] | |
267 | $ rm pickle |
|
267 | $ rm pickle | |
268 |
|
268 | |||
269 | $ echo "^ignoreddir$" > .hgignore |
|
269 | $ echo "^ignoreddir$" > .hgignore | |
270 | $ mkdir ignoreddir |
|
270 | $ mkdir ignoreddir | |
271 | $ touch ignoreddir/file |
|
271 | $ touch ignoreddir/file | |
272 |
|
272 | |||
273 | Test templater support: |
|
273 | Test templater support: | |
274 |
|
274 | |||
275 | $ hg status -AT "[{status}]\t{if(copy, '{copy} -> ')}{path}\n" |
|
275 | $ hg status -AT "[{status}]\t{if(copy, '{copy} -> ')}{path}\n" | |
276 | [M] .hgignore |
|
276 | [M] .hgignore | |
277 | [A] added |
|
277 | [A] added | |
278 | [A] modified -> copied |
|
278 | [A] modified -> copied | |
279 | [R] removed |
|
279 | [R] removed | |
280 | [!] deleted |
|
280 | [!] deleted | |
281 | [?] ignored |
|
281 | [?] ignored | |
282 | [?] unknown |
|
282 | [?] unknown | |
283 | [I] ignoreddir/file |
|
283 | [I] ignoreddir/file | |
284 | [C] modified |
|
284 | [C] modified | |
285 | $ hg status -AT default |
|
285 | $ hg status -AT default | |
286 | M .hgignore |
|
286 | M .hgignore | |
287 | A added |
|
287 | A added | |
288 | A copied |
|
288 | A copied | |
289 | modified |
|
289 | modified | |
290 | R removed |
|
290 | R removed | |
291 | ! deleted |
|
291 | ! deleted | |
292 | ? ignored |
|
292 | ? ignored | |
293 | ? unknown |
|
293 | ? unknown | |
294 | I ignoreddir/file |
|
294 | I ignoreddir/file | |
295 | C modified |
|
295 | C modified | |
296 | $ hg status -T compact |
|
296 | $ hg status -T compact | |
297 | abort: "status" not in template map |
|
297 | abort: "status" not in template map | |
298 | [255] |
|
298 | [255] | |
299 |
|
299 | |||
300 | hg status ignoreddir/file: |
|
300 | hg status ignoreddir/file: | |
301 |
|
301 | |||
302 | $ hg status ignoreddir/file |
|
302 | $ hg status ignoreddir/file | |
303 |
|
303 | |||
304 | hg status -i ignoreddir/file: |
|
304 | hg status -i ignoreddir/file: | |
305 |
|
305 | |||
306 | $ hg status -i ignoreddir/file |
|
306 | $ hg status -i ignoreddir/file | |
307 | I ignoreddir/file |
|
307 | I ignoreddir/file | |
308 | $ cd .. |
|
308 | $ cd .. | |
309 |
|
309 | |||
310 | Check 'status -q' and some combinations |
|
310 | Check 'status -q' and some combinations | |
311 |
|
311 | |||
312 | $ hg init repo3 |
|
312 | $ hg init repo3 | |
313 | $ cd repo3 |
|
313 | $ cd repo3 | |
314 | $ touch modified removed deleted ignored |
|
314 | $ touch modified removed deleted ignored | |
315 | $ echo "^ignored$" > .hgignore |
|
315 | $ echo "^ignored$" > .hgignore | |
316 | $ hg commit -A -m 'initial checkin' |
|
316 | $ hg commit -A -m 'initial checkin' | |
317 | adding .hgignore |
|
317 | adding .hgignore | |
318 | adding deleted |
|
318 | adding deleted | |
319 | adding modified |
|
319 | adding modified | |
320 | adding removed |
|
320 | adding removed | |
321 | $ touch added unknown ignored |
|
321 | $ touch added unknown ignored | |
322 | $ hg add added |
|
322 | $ hg add added | |
323 | $ echo "test" >> modified |
|
323 | $ echo "test" >> modified | |
324 | $ hg remove removed |
|
324 | $ hg remove removed | |
325 | $ rm deleted |
|
325 | $ rm deleted | |
326 | $ hg copy modified copied |
|
326 | $ hg copy modified copied | |
327 |
|
327 | |||
328 | Specify working directory revision explicitly, that should be the same as |
|
328 | Specify working directory revision explicitly, that should be the same as | |
329 | "hg status" |
|
329 | "hg status" | |
330 |
|
330 | |||
331 | $ hg status --change "wdir()" |
|
331 | $ hg status --change "wdir()" | |
332 | M modified |
|
332 | M modified | |
333 | A added |
|
333 | A added | |
334 | A copied |
|
334 | A copied | |
335 | R removed |
|
335 | R removed | |
336 | ! deleted |
|
336 | ! deleted | |
337 | ? unknown |
|
337 | ? unknown | |
338 |
|
338 | |||
339 | Run status with 2 different flags. |
|
339 | Run status with 2 different flags. | |
340 | Check if result is the same or different. |
|
340 | Check if result is the same or different. | |
341 | If result is not as expected, raise error |
|
341 | If result is not as expected, raise error | |
342 |
|
342 | |||
343 | $ assert() { |
|
343 | $ assert() { | |
344 | > hg status $1 > ../a |
|
344 | > hg status $1 > ../a | |
345 | > hg status $2 > ../b |
|
345 | > hg status $2 > ../b | |
346 | > if diff ../a ../b > /dev/null; then |
|
346 | > if diff ../a ../b > /dev/null; then | |
347 | > out=0 |
|
347 | > out=0 | |
348 | > else |
|
348 | > else | |
349 | > out=1 |
|
349 | > out=1 | |
350 | > fi |
|
350 | > fi | |
351 | > if [ $3 -eq 0 ]; then |
|
351 | > if [ $3 -eq 0 ]; then | |
352 | > df="same" |
|
352 | > df="same" | |
353 | > else |
|
353 | > else | |
354 | > df="different" |
|
354 | > df="different" | |
355 | > fi |
|
355 | > fi | |
356 | > if [ $out -ne $3 ]; then |
|
356 | > if [ $out -ne $3 ]; then | |
357 | > echo "Error on $1 and $2, should be $df." |
|
357 | > echo "Error on $1 and $2, should be $df." | |
358 | > fi |
|
358 | > fi | |
359 | > } |
|
359 | > } | |
360 |
|
360 | |||
361 | Assert flag1 flag2 [0-same | 1-different] |
|
361 | Assert flag1 flag2 [0-same | 1-different] | |
362 |
|
362 | |||
363 | $ assert "-q" "-mard" 0 |
|
363 | $ assert "-q" "-mard" 0 | |
364 | $ assert "-A" "-marduicC" 0 |
|
364 | $ assert "-A" "-marduicC" 0 | |
365 | $ assert "-qA" "-mardcC" 0 |
|
365 | $ assert "-qA" "-mardcC" 0 | |
366 | $ assert "-qAui" "-A" 0 |
|
366 | $ assert "-qAui" "-A" 0 | |
367 | $ assert "-qAu" "-marducC" 0 |
|
367 | $ assert "-qAu" "-marducC" 0 | |
368 | $ assert "-qAi" "-mardicC" 0 |
|
368 | $ assert "-qAi" "-mardicC" 0 | |
369 | $ assert "-qu" "-u" 0 |
|
369 | $ assert "-qu" "-u" 0 | |
370 | $ assert "-q" "-u" 1 |
|
370 | $ assert "-q" "-u" 1 | |
371 | $ assert "-m" "-a" 1 |
|
371 | $ assert "-m" "-a" 1 | |
372 | $ assert "-r" "-d" 1 |
|
372 | $ assert "-r" "-d" 1 | |
373 | $ cd .. |
|
373 | $ cd .. | |
374 |
|
374 | |||
375 | $ hg init repo4 |
|
375 | $ hg init repo4 | |
376 | $ cd repo4 |
|
376 | $ cd repo4 | |
377 | $ touch modified removed deleted |
|
377 | $ touch modified removed deleted | |
378 | $ hg ci -q -A -m 'initial checkin' |
|
378 | $ hg ci -q -A -m 'initial checkin' | |
379 | $ touch added unknown |
|
379 | $ touch added unknown | |
380 | $ hg add added |
|
380 | $ hg add added | |
381 | $ hg remove removed |
|
381 | $ hg remove removed | |
382 | $ rm deleted |
|
382 | $ rm deleted | |
383 | $ echo x > modified |
|
383 | $ echo x > modified | |
384 | $ hg copy modified copied |
|
384 | $ hg copy modified copied | |
385 | $ hg ci -m 'test checkin' -d "1000001 0" |
|
385 | $ hg ci -m 'test checkin' -d "1000001 0" | |
386 | $ rm * |
|
386 | $ rm * | |
387 | $ touch unrelated |
|
387 | $ touch unrelated | |
388 | $ hg ci -q -A -m 'unrelated checkin' -d "1000002 0" |
|
388 | $ hg ci -q -A -m 'unrelated checkin' -d "1000002 0" | |
389 |
|
389 | |||
390 | hg status --change 1: |
|
390 | hg status --change 1: | |
391 |
|
391 | |||
392 | $ hg status --change 1 |
|
392 | $ hg status --change 1 | |
393 | M modified |
|
393 | M modified | |
394 | A added |
|
394 | A added | |
395 | A copied |
|
395 | A copied | |
396 | R removed |
|
396 | R removed | |
397 |
|
397 | |||
398 | hg status --change 1 unrelated: |
|
398 | hg status --change 1 unrelated: | |
399 |
|
399 | |||
400 | $ hg status --change 1 unrelated |
|
400 | $ hg status --change 1 unrelated | |
401 |
|
401 | |||
402 | hg status -C --change 1 added modified copied removed deleted: |
|
402 | hg status -C --change 1 added modified copied removed deleted: | |
403 |
|
403 | |||
404 | $ hg status -C --change 1 added modified copied removed deleted |
|
404 | $ hg status -C --change 1 added modified copied removed deleted | |
405 | M modified |
|
405 | M modified | |
406 | A added |
|
406 | A added | |
407 | A copied |
|
407 | A copied | |
408 | modified |
|
408 | modified | |
409 | R removed |
|
409 | R removed | |
410 |
|
410 | |||
411 | hg status -A --change 1 and revset: |
|
411 | hg status -A --change 1 and revset: | |
412 |
|
412 | |||
413 | $ hg status -A --change '1|1' |
|
413 | $ hg status -A --change '1|1' | |
414 | M modified |
|
414 | M modified | |
415 | A added |
|
415 | A added | |
416 | A copied |
|
416 | A copied | |
417 | modified |
|
417 | modified | |
418 | R removed |
|
418 | R removed | |
419 | C deleted |
|
419 | C deleted | |
420 |
|
420 | |||
421 | $ cd .. |
|
421 | $ cd .. | |
422 |
|
422 | |||
423 | hg status with --rev and reverted changes: |
|
423 | hg status with --rev and reverted changes: | |
424 |
|
424 | |||
425 | $ hg init reverted-changes-repo |
|
425 | $ hg init reverted-changes-repo | |
426 | $ cd reverted-changes-repo |
|
426 | $ cd reverted-changes-repo | |
427 | $ echo a > file |
|
427 | $ echo a > file | |
428 | $ hg add file |
|
428 | $ hg add file | |
429 | $ hg ci -m a |
|
429 | $ hg ci -m a | |
430 | $ echo b > file |
|
430 | $ echo b > file | |
431 | $ hg ci -m b |
|
431 | $ hg ci -m b | |
432 |
|
432 | |||
433 | reverted file should appear clean |
|
433 | reverted file should appear clean | |
434 |
|
434 | |||
435 | $ hg revert -r 0 . |
|
435 | $ hg revert -r 0 . | |
436 | reverting file |
|
436 | reverting file | |
437 | $ hg status -A --rev 0 |
|
437 | $ hg status -A --rev 0 | |
438 | C file |
|
438 | C file | |
439 |
|
439 | |||
440 | #if execbit |
|
440 | #if execbit | |
441 | reverted file with changed flag should appear modified |
|
441 | reverted file with changed flag should appear modified | |
442 |
|
442 | |||
443 | $ chmod +x file |
|
443 | $ chmod +x file | |
444 | $ hg status -A --rev 0 |
|
444 | $ hg status -A --rev 0 | |
445 | M file |
|
445 | M file | |
446 |
|
446 | |||
447 | $ hg revert -r 0 . |
|
447 | $ hg revert -r 0 . | |
448 | reverting file |
|
448 | reverting file | |
449 |
|
449 | |||
450 | reverted and committed file with changed flag should appear modified |
|
450 | reverted and committed file with changed flag should appear modified | |
451 |
|
451 | |||
452 | $ hg co -C . |
|
452 | $ hg co -C . | |
453 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
453 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
454 | $ chmod +x file |
|
454 | $ chmod +x file | |
455 | $ hg ci -m 'change flag' |
|
455 | $ hg ci -m 'change flag' | |
456 | $ hg status -A --rev 1 --rev 2 |
|
456 | $ hg status -A --rev 1 --rev 2 | |
457 | M file |
|
457 | M file | |
458 | $ hg diff -r 1 -r 2 |
|
458 | $ hg diff -r 1 -r 2 | |
459 |
|
459 | |||
460 | #endif |
|
460 | #endif | |
461 |
|
461 | |||
462 | $ cd .. |
|
462 | $ cd .. | |
463 |
|
463 | |||
464 | hg status of binary file starting with '\1\n', a separator for metadata: |
|
464 | hg status of binary file starting with '\1\n', a separator for metadata: | |
465 |
|
465 | |||
466 | $ hg init repo5 |
|
466 | $ hg init repo5 | |
467 | $ cd repo5 |
|
467 | $ cd repo5 | |
468 | >>> open("010a", "wb").write("\1\nfoo") |
|
468 | >>> open("010a", r"wb").write(b"\1\nfoo") | |
469 | $ hg ci -q -A -m 'initial checkin' |
|
469 | $ hg ci -q -A -m 'initial checkin' | |
470 | $ hg status -A |
|
470 | $ hg status -A | |
471 | C 010a |
|
471 | C 010a | |
472 |
|
472 | |||
473 | >>> open("010a", "wb").write("\1\nbar") |
|
473 | >>> open("010a", r"wb").write(b"\1\nbar") | |
474 | $ hg status -A |
|
474 | $ hg status -A | |
475 | M 010a |
|
475 | M 010a | |
476 | $ hg ci -q -m 'modify 010a' |
|
476 | $ hg ci -q -m 'modify 010a' | |
477 | $ hg status -A --rev 0:1 |
|
477 | $ hg status -A --rev 0:1 | |
478 | M 010a |
|
478 | M 010a | |
479 |
|
479 | |||
480 | $ touch empty |
|
480 | $ touch empty | |
481 | $ hg ci -q -A -m 'add another file' |
|
481 | $ hg ci -q -A -m 'add another file' | |
482 | $ hg status -A --rev 1:2 010a |
|
482 | $ hg status -A --rev 1:2 010a | |
483 | C 010a |
|
483 | C 010a | |
484 |
|
484 | |||
485 | $ cd .. |
|
485 | $ cd .. | |
486 |
|
486 | |||
487 | test "hg status" with "directory pattern" which matches against files |
|
487 | test "hg status" with "directory pattern" which matches against files | |
488 | only known on target revision. |
|
488 | only known on target revision. | |
489 |
|
489 | |||
490 | $ hg init repo6 |
|
490 | $ hg init repo6 | |
491 | $ cd repo6 |
|
491 | $ cd repo6 | |
492 |
|
492 | |||
493 | $ echo a > a.txt |
|
493 | $ echo a > a.txt | |
494 | $ hg add a.txt |
|
494 | $ hg add a.txt | |
495 | $ hg commit -m '#0' |
|
495 | $ hg commit -m '#0' | |
496 | $ mkdir -p 1/2/3/4/5 |
|
496 | $ mkdir -p 1/2/3/4/5 | |
497 | $ echo b > 1/2/3/4/5/b.txt |
|
497 | $ echo b > 1/2/3/4/5/b.txt | |
498 | $ hg add 1/2/3/4/5/b.txt |
|
498 | $ hg add 1/2/3/4/5/b.txt | |
499 | $ hg commit -m '#1' |
|
499 | $ hg commit -m '#1' | |
500 |
|
500 | |||
501 | $ hg update -C 0 > /dev/null |
|
501 | $ hg update -C 0 > /dev/null | |
502 | $ hg status -A |
|
502 | $ hg status -A | |
503 | C a.txt |
|
503 | C a.txt | |
504 |
|
504 | |||
505 | the directory matching against specified pattern should be removed, |
|
505 | the directory matching against specified pattern should be removed, | |
506 | because directory existence prevents 'dirstate.walk()' from showing |
|
506 | because directory existence prevents 'dirstate.walk()' from showing | |
507 | warning message about such pattern. |
|
507 | warning message about such pattern. | |
508 |
|
508 | |||
509 | $ test ! -d 1 |
|
509 | $ test ! -d 1 | |
510 | $ hg status -A --rev 1 1/2/3/4/5/b.txt |
|
510 | $ hg status -A --rev 1 1/2/3/4/5/b.txt | |
511 | R 1/2/3/4/5/b.txt |
|
511 | R 1/2/3/4/5/b.txt | |
512 | $ hg status -A --rev 1 1/2/3/4/5 |
|
512 | $ hg status -A --rev 1 1/2/3/4/5 | |
513 | R 1/2/3/4/5/b.txt |
|
513 | R 1/2/3/4/5/b.txt | |
514 | $ hg status -A --rev 1 1/2/3 |
|
514 | $ hg status -A --rev 1 1/2/3 | |
515 | R 1/2/3/4/5/b.txt |
|
515 | R 1/2/3/4/5/b.txt | |
516 | $ hg status -A --rev 1 1 |
|
516 | $ hg status -A --rev 1 1 | |
517 | R 1/2/3/4/5/b.txt |
|
517 | R 1/2/3/4/5/b.txt | |
518 |
|
518 | |||
519 | $ hg status --config ui.formatdebug=True --rev 1 1 |
|
519 | $ hg status --config ui.formatdebug=True --rev 1 1 | |
520 | status = [ |
|
520 | status = [ | |
521 | {*'path': '1/2/3/4/5/b.txt'*}, (glob) |
|
521 | {*'path': '1/2/3/4/5/b.txt'*}, (glob) | |
522 | ] |
|
522 | ] | |
523 |
|
523 | |||
524 | #if windows |
|
524 | #if windows | |
525 | $ hg --config ui.slash=false status -A --rev 1 1 |
|
525 | $ hg --config ui.slash=false status -A --rev 1 1 | |
526 | R 1\2\3\4\5\b.txt |
|
526 | R 1\2\3\4\5\b.txt | |
527 | #endif |
|
527 | #endif | |
528 |
|
528 | |||
529 | $ cd .. |
|
529 | $ cd .. | |
530 |
|
530 | |||
531 | Status after move overwriting a file (issue4458) |
|
531 | Status after move overwriting a file (issue4458) | |
532 | ================================================= |
|
532 | ================================================= | |
533 |
|
533 | |||
534 |
|
534 | |||
535 | $ hg init issue4458 |
|
535 | $ hg init issue4458 | |
536 | $ cd issue4458 |
|
536 | $ cd issue4458 | |
537 | $ echo a > a |
|
537 | $ echo a > a | |
538 | $ echo b > b |
|
538 | $ echo b > b | |
539 | $ hg commit -Am base |
|
539 | $ hg commit -Am base | |
540 | adding a |
|
540 | adding a | |
541 | adding b |
|
541 | adding b | |
542 |
|
542 | |||
543 |
|
543 | |||
544 | with --force |
|
544 | with --force | |
545 |
|
545 | |||
546 | $ hg mv b --force a |
|
546 | $ hg mv b --force a | |
547 | $ hg st --copies |
|
547 | $ hg st --copies | |
548 | M a |
|
548 | M a | |
549 | b |
|
549 | b | |
550 | R b |
|
550 | R b | |
551 | $ hg revert --all |
|
551 | $ hg revert --all | |
552 | reverting a |
|
552 | reverting a | |
553 | undeleting b |
|
553 | undeleting b | |
554 | $ rm *.orig |
|
554 | $ rm *.orig | |
555 |
|
555 | |||
556 | without force |
|
556 | without force | |
557 |
|
557 | |||
558 | $ hg rm a |
|
558 | $ hg rm a | |
559 | $ hg st --copies |
|
559 | $ hg st --copies | |
560 | R a |
|
560 | R a | |
561 | $ hg mv b a |
|
561 | $ hg mv b a | |
562 | $ hg st --copies |
|
562 | $ hg st --copies | |
563 | M a |
|
563 | M a | |
564 | b |
|
564 | b | |
565 | R b |
|
565 | R b | |
566 |
|
566 | |||
567 | using ui.statuscopies setting |
|
567 | using ui.statuscopies setting | |
568 | $ hg st --config ui.statuscopies=true |
|
568 | $ hg st --config ui.statuscopies=true | |
569 | M a |
|
569 | M a | |
570 | b |
|
570 | b | |
571 | R b |
|
571 | R b | |
572 | $ hg st --config ui.statuscopies=false |
|
572 | $ hg st --config ui.statuscopies=false | |
573 | M a |
|
573 | M a | |
574 | R b |
|
574 | R b | |
575 | $ hg st --config ui.tweakdefaults=yes |
|
575 | $ hg st --config ui.tweakdefaults=yes | |
576 | M a |
|
576 | M a | |
577 | b |
|
577 | b | |
578 | R b |
|
578 | R b | |
579 |
|
579 | |||
580 | using log status template (issue5155) |
|
580 | using log status template (issue5155) | |
581 | $ hg log -Tstatus -r 'wdir()' -C |
|
581 | $ hg log -Tstatus -r 'wdir()' -C | |
582 | changeset: 2147483647:ffffffffffff |
|
582 | changeset: 2147483647:ffffffffffff | |
583 | parent: 0:8c55c58b4c0e |
|
583 | parent: 0:8c55c58b4c0e | |
584 | user: test |
|
584 | user: test | |
585 | date: * (glob) |
|
585 | date: * (glob) | |
586 | files: |
|
586 | files: | |
587 | M a |
|
587 | M a | |
588 | b |
|
588 | b | |
589 | R b |
|
589 | R b | |
590 |
|
590 | |||
591 |
|
591 | |||
592 | Other "bug" highlight, the revision status does not report the copy information. |
|
592 | Other "bug" highlight, the revision status does not report the copy information. | |
593 | This is buggy behavior. |
|
593 | This is buggy behavior. | |
594 |
|
594 | |||
595 | $ hg commit -m 'blah' |
|
595 | $ hg commit -m 'blah' | |
596 | $ hg st --copies --change . |
|
596 | $ hg st --copies --change . | |
597 | M a |
|
597 | M a | |
598 | R b |
|
598 | R b | |
599 |
|
599 | |||
600 | using log status template, the copy information is displayed correctly. |
|
600 | using log status template, the copy information is displayed correctly. | |
601 | $ hg log -Tstatus -r. -C |
|
601 | $ hg log -Tstatus -r. -C | |
602 | changeset: 1:6685fde43d21 |
|
602 | changeset: 1:6685fde43d21 | |
603 | tag: tip |
|
603 | tag: tip | |
604 | user: test |
|
604 | user: test | |
605 | date: * (glob) |
|
605 | date: * (glob) | |
606 | summary: blah |
|
606 | summary: blah | |
607 | files: |
|
607 | files: | |
608 | M a |
|
608 | M a | |
609 | b |
|
609 | b | |
610 | R b |
|
610 | R b | |
611 |
|
611 | |||
612 |
|
612 | |||
613 | $ cd .. |
|
613 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now