Show More
@@ -1,655 +1,665 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 |
|
126 | ? 1/in_a_1 | |
127 | ? in_a |
|
127 | ? in_a | |
128 | ? ../b/1/in_b_1 |
|
128 | ? ../b/1/in_b_1 | |
129 | ? ../b/2/in_b_2 |
|
129 | ? ../b/2/in_b_2 | |
130 | ? ../b/in_b |
|
130 | ? ../b/in_b | |
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 | $ hg status --cwd a --config ui.relative-paths=yes |
|
135 | $ hg status --cwd a --config ui.relative-paths=yes | |
136 | ? 1/in_a_1 |
|
136 | ? 1/in_a_1 | |
137 | ? in_a |
|
137 | ? in_a | |
138 | ? ../b/1/in_b_1 |
|
138 | ? ../b/1/in_b_1 | |
139 | ? ../b/2/in_b_2 |
|
139 | ? ../b/2/in_b_2 | |
140 | ? ../b/in_b |
|
140 | ? ../b/in_b | |
141 | ? ../in_root |
|
141 | ? ../in_root | |
142 |
|
142 | |||
143 | $ hg status --cwd a . --config ui.relative-paths=legacy |
|
143 | $ hg status --cwd a . --config ui.relative-paths=legacy | |
144 | ? 1/in_a_1 |
|
144 | ? 1/in_a_1 | |
145 | ? in_a |
|
145 | ? in_a | |
146 | $ hg status --cwd a . --config ui.relative-paths=no |
|
146 | $ hg status --cwd a . --config ui.relative-paths=no | |
147 | ? a/1/in_a_1 |
|
147 | ? a/1/in_a_1 | |
148 | ? a/in_a |
|
148 | ? a/in_a | |
149 |
|
149 | |||
150 | commands.status.relative overrides ui.relative-paths |
|
150 | commands.status.relative overrides ui.relative-paths | |
151 |
|
151 | |||
152 | $ cat >> $HGRCPATH <<EOF |
|
152 | $ cat >> $HGRCPATH <<EOF | |
153 | > [ui] |
|
153 | > [ui] | |
154 | > relative-paths = False |
|
154 | > relative-paths = False | |
155 | > [commands] |
|
155 | > [commands] | |
156 | > status.relative = True |
|
156 | > status.relative = True | |
157 | > EOF |
|
157 | > EOF | |
158 | $ hg status --cwd a |
|
158 | $ hg status --cwd a | |
159 | ? 1/in_a_1 |
|
159 | ? 1/in_a_1 | |
160 | ? in_a |
|
160 | ? in_a | |
161 | ? ../b/1/in_b_1 |
|
161 | ? ../b/1/in_b_1 | |
162 | ? ../b/2/in_b_2 |
|
162 | ? ../b/2/in_b_2 | |
163 | ? ../b/in_b |
|
163 | ? ../b/in_b | |
164 | ? ../in_root |
|
164 | ? ../in_root | |
165 | $ HGPLAIN=1 hg status --cwd a |
|
165 | $ HGPLAIN=1 hg status --cwd a | |
166 | ? a/1/in_a_1 (glob) |
|
166 | ? a/1/in_a_1 (glob) | |
167 | ? a/in_a (glob) |
|
167 | ? a/in_a (glob) | |
168 | ? b/1/in_b_1 (glob) |
|
168 | ? b/1/in_b_1 (glob) | |
169 | ? b/2/in_b_2 (glob) |
|
169 | ? b/2/in_b_2 (glob) | |
170 | ? b/in_b (glob) |
|
170 | ? b/in_b (glob) | |
171 | ? in_root |
|
171 | ? in_root | |
172 |
|
172 | |||
173 | if relative paths are explicitly off, tweakdefaults doesn't change it |
|
173 | if relative paths are explicitly off, tweakdefaults doesn't change it | |
174 | $ cat >> $HGRCPATH <<EOF |
|
174 | $ cat >> $HGRCPATH <<EOF | |
175 | > [commands] |
|
175 | > [commands] | |
176 | > status.relative = False |
|
176 | > status.relative = False | |
177 | > EOF |
|
177 | > EOF | |
178 | $ hg status --cwd a --config ui.tweakdefaults=yes |
|
178 | $ hg status --cwd a --config ui.tweakdefaults=yes | |
179 | ? a/1/in_a_1 |
|
179 | ? a/1/in_a_1 | |
180 | ? a/in_a |
|
180 | ? a/in_a | |
181 | ? b/1/in_b_1 |
|
181 | ? b/1/in_b_1 | |
182 | ? b/2/in_b_2 |
|
182 | ? b/2/in_b_2 | |
183 | ? b/in_b |
|
183 | ? b/in_b | |
184 | ? in_root |
|
184 | ? in_root | |
185 |
|
185 | |||
186 | $ cd .. |
|
186 | $ cd .. | |
187 |
|
187 | |||
188 | $ hg init repo2 |
|
188 | $ hg init repo2 | |
189 | $ cd repo2 |
|
189 | $ cd repo2 | |
190 | $ touch modified removed deleted ignored |
|
190 | $ touch modified removed deleted ignored | |
191 | $ echo "^ignored$" > .hgignore |
|
191 | $ echo "^ignored$" > .hgignore | |
192 | $ hg ci -A -m 'initial checkin' |
|
192 | $ hg ci -A -m 'initial checkin' | |
193 | adding .hgignore |
|
193 | adding .hgignore | |
194 | adding deleted |
|
194 | adding deleted | |
195 | adding modified |
|
195 | adding modified | |
196 | adding removed |
|
196 | adding removed | |
197 | $ touch modified added unknown ignored |
|
197 | $ touch modified added unknown ignored | |
198 | $ hg add added |
|
198 | $ hg add added | |
199 | $ hg remove removed |
|
199 | $ hg remove removed | |
200 | $ rm deleted |
|
200 | $ rm deleted | |
201 |
|
201 | |||
202 | hg status: |
|
202 | hg status: | |
203 |
|
203 | |||
204 | $ hg status |
|
204 | $ hg status | |
205 | A added |
|
205 | A added | |
206 | R removed |
|
206 | R removed | |
207 | ! deleted |
|
207 | ! deleted | |
208 | ? unknown |
|
208 | ? unknown | |
209 |
|
209 | |||
210 | hg status modified added removed deleted unknown never-existed ignored: |
|
210 | hg status modified added removed deleted unknown never-existed ignored: | |
211 |
|
211 | |||
212 | $ hg status modified added removed deleted unknown never-existed ignored |
|
212 | $ hg status modified added removed deleted unknown never-existed ignored | |
213 | never-existed: * (glob) |
|
213 | never-existed: * (glob) | |
214 | A added |
|
214 | A added | |
215 | R removed |
|
215 | R removed | |
216 | ! deleted |
|
216 | ! deleted | |
217 | ? unknown |
|
217 | ? unknown | |
218 |
|
218 | |||
219 | $ hg copy modified copied |
|
219 | $ hg copy modified copied | |
220 |
|
220 | |||
221 | hg status -C: |
|
221 | hg status -C: | |
222 |
|
222 | |||
223 | $ hg status -C |
|
223 | $ hg status -C | |
224 | A added |
|
224 | A added | |
225 | A copied |
|
225 | A copied | |
226 | modified |
|
226 | modified | |
227 | R removed |
|
227 | R removed | |
228 | ! deleted |
|
228 | ! deleted | |
229 | ? unknown |
|
229 | ? unknown | |
230 |
|
230 | |||
231 | hg status -A: |
|
231 | hg status -A: | |
232 |
|
232 | |||
233 | $ hg status -A |
|
233 | $ hg status -A | |
234 | A added |
|
234 | A added | |
235 | A copied |
|
235 | A copied | |
236 | modified |
|
236 | modified | |
237 | R removed |
|
237 | R removed | |
238 | ! deleted |
|
238 | ! deleted | |
239 | ? unknown |
|
239 | ? unknown | |
240 | I ignored |
|
240 | I ignored | |
241 | C .hgignore |
|
241 | C .hgignore | |
242 | C modified |
|
242 | C modified | |
243 |
|
243 | |||
244 | $ hg status -A -T '{status} {path} {node|shortest}\n' |
|
244 | $ hg status -A -T '{status} {path} {node|shortest}\n' | |
245 | A added ffff |
|
245 | A added ffff | |
246 | A copied ffff |
|
246 | A copied ffff | |
247 | R removed ffff |
|
247 | R removed ffff | |
248 | ! deleted ffff |
|
248 | ! deleted ffff | |
249 | ? unknown ffff |
|
249 | ? unknown ffff | |
250 | I ignored ffff |
|
250 | I ignored ffff | |
251 | C .hgignore ffff |
|
251 | C .hgignore ffff | |
252 | C modified ffff |
|
252 | C modified ffff | |
253 |
|
253 | |||
254 | $ hg status -A -Tjson |
|
254 | $ hg status -A -Tjson | |
255 | [ |
|
255 | [ | |
256 | { |
|
256 | { | |
257 | "path": "added", |
|
257 | "path": "added", | |
258 | "status": "A" |
|
258 | "status": "A" | |
259 | }, |
|
259 | }, | |
260 | { |
|
260 | { | |
261 | "path": "copied", |
|
261 | "path": "copied", | |
262 | "source": "modified", |
|
262 | "source": "modified", | |
263 | "status": "A" |
|
263 | "status": "A" | |
264 | }, |
|
264 | }, | |
265 | { |
|
265 | { | |
266 | "path": "removed", |
|
266 | "path": "removed", | |
267 | "status": "R" |
|
267 | "status": "R" | |
268 | }, |
|
268 | }, | |
269 | { |
|
269 | { | |
270 | "path": "deleted", |
|
270 | "path": "deleted", | |
271 | "status": "!" |
|
271 | "status": "!" | |
272 | }, |
|
272 | }, | |
273 | { |
|
273 | { | |
274 | "path": "unknown", |
|
274 | "path": "unknown", | |
275 | "status": "?" |
|
275 | "status": "?" | |
276 | }, |
|
276 | }, | |
277 | { |
|
277 | { | |
278 | "path": "ignored", |
|
278 | "path": "ignored", | |
279 | "status": "I" |
|
279 | "status": "I" | |
280 | }, |
|
280 | }, | |
281 | { |
|
281 | { | |
282 | "path": ".hgignore", |
|
282 | "path": ".hgignore", | |
283 | "status": "C" |
|
283 | "status": "C" | |
284 | }, |
|
284 | }, | |
285 | { |
|
285 | { | |
286 | "path": "modified", |
|
286 | "path": "modified", | |
287 | "status": "C" |
|
287 | "status": "C" | |
288 | } |
|
288 | } | |
289 | ] |
|
289 | ] | |
290 |
|
290 | |||
291 | $ hg status -A -Tpickle > pickle |
|
291 | $ hg status -A -Tpickle > pickle | |
292 | >>> from __future__ import print_function |
|
292 | >>> from __future__ import print_function | |
293 | >>> from mercurial import util |
|
293 | >>> from mercurial import util | |
294 | >>> pickle = util.pickle |
|
294 | >>> pickle = util.pickle | |
295 | >>> data = sorted((x[b'status'].decode(), x[b'path'].decode()) for x in pickle.load(open("pickle", r"rb"))) |
|
295 | >>> data = sorted((x[b'status'].decode(), x[b'path'].decode()) for x in pickle.load(open("pickle", r"rb"))) | |
296 | >>> for s, p in data: print("%s %s" % (s, p)) |
|
296 | >>> for s, p in data: print("%s %s" % (s, p)) | |
297 | ! deleted |
|
297 | ! deleted | |
298 | ? pickle |
|
298 | ? pickle | |
299 | ? unknown |
|
299 | ? unknown | |
300 | A added |
|
300 | A added | |
301 | A copied |
|
301 | A copied | |
302 | C .hgignore |
|
302 | C .hgignore | |
303 | C modified |
|
303 | C modified | |
304 | I ignored |
|
304 | I ignored | |
305 | R removed |
|
305 | R removed | |
306 | $ rm pickle |
|
306 | $ rm pickle | |
307 |
|
307 | |||
308 | $ echo "^ignoreddir$" > .hgignore |
|
308 | $ echo "^ignoreddir$" > .hgignore | |
309 | $ mkdir ignoreddir |
|
309 | $ mkdir ignoreddir | |
310 | $ touch ignoreddir/file |
|
310 | $ touch ignoreddir/file | |
311 |
|
311 | |||
312 | Test templater support: |
|
312 | Test templater support: | |
313 |
|
313 | |||
314 | $ hg status -AT "[{status}]\t{if(source, '{source} -> ')}{path}\n" |
|
314 | $ hg status -AT "[{status}]\t{if(source, '{source} -> ')}{path}\n" | |
315 | [M] .hgignore |
|
315 | [M] .hgignore | |
316 | [A] added |
|
316 | [A] added | |
317 | [A] modified -> copied |
|
317 | [A] modified -> copied | |
318 | [R] removed |
|
318 | [R] removed | |
319 | [!] deleted |
|
319 | [!] deleted | |
320 | [?] ignored |
|
320 | [?] ignored | |
321 | [?] unknown |
|
321 | [?] unknown | |
322 | [I] ignoreddir/file |
|
322 | [I] ignoreddir/file | |
323 | [C] modified |
|
323 | [C] modified | |
324 | $ hg status -AT default |
|
324 | $ hg status -AT default | |
325 | M .hgignore |
|
325 | M .hgignore | |
326 | A added |
|
326 | A added | |
327 | A copied |
|
327 | A copied | |
328 | modified |
|
328 | modified | |
329 | R removed |
|
329 | R removed | |
330 | ! deleted |
|
330 | ! deleted | |
331 | ? ignored |
|
331 | ? ignored | |
332 | ? unknown |
|
332 | ? unknown | |
333 | I ignoreddir/file |
|
333 | I ignoreddir/file | |
334 | C modified |
|
334 | C modified | |
335 | $ hg status -T compact |
|
335 | $ hg status -T compact | |
336 | abort: "status" not in template map |
|
336 | abort: "status" not in template map | |
337 | [255] |
|
337 | [255] | |
338 |
|
338 | |||
339 | hg status ignoreddir/file: |
|
339 | hg status ignoreddir/file: | |
340 |
|
340 | |||
341 | $ hg status ignoreddir/file |
|
341 | $ hg status ignoreddir/file | |
342 |
|
342 | |||
343 | hg status -i ignoreddir/file: |
|
343 | hg status -i ignoreddir/file: | |
344 |
|
344 | |||
345 | $ hg status -i ignoreddir/file |
|
345 | $ hg status -i ignoreddir/file | |
346 | I ignoreddir/file |
|
346 | I ignoreddir/file | |
347 | $ cd .. |
|
347 | $ cd .. | |
348 |
|
348 | |||
349 | Check 'status -q' and some combinations |
|
349 | Check 'status -q' and some combinations | |
350 |
|
350 | |||
351 | $ hg init repo3 |
|
351 | $ hg init repo3 | |
352 | $ cd repo3 |
|
352 | $ cd repo3 | |
353 | $ touch modified removed deleted ignored |
|
353 | $ touch modified removed deleted ignored | |
354 | $ echo "^ignored$" > .hgignore |
|
354 | $ echo "^ignored$" > .hgignore | |
355 | $ hg commit -A -m 'initial checkin' |
|
355 | $ hg commit -A -m 'initial checkin' | |
356 | adding .hgignore |
|
356 | adding .hgignore | |
357 | adding deleted |
|
357 | adding deleted | |
358 | adding modified |
|
358 | adding modified | |
359 | adding removed |
|
359 | adding removed | |
360 | $ touch added unknown ignored |
|
360 | $ touch added unknown ignored | |
361 | $ hg add added |
|
361 | $ hg add added | |
362 | $ echo "test" >> modified |
|
362 | $ echo "test" >> modified | |
363 | $ hg remove removed |
|
363 | $ hg remove removed | |
364 | $ rm deleted |
|
364 | $ rm deleted | |
365 | $ hg copy modified copied |
|
365 | $ hg copy modified copied | |
366 |
|
366 | |||
367 | Specify working directory revision explicitly, that should be the same as |
|
367 | Specify working directory revision explicitly, that should be the same as | |
368 | "hg status" |
|
368 | "hg status" | |
369 |
|
369 | |||
370 | $ hg status --change "wdir()" |
|
370 | $ hg status --change "wdir()" | |
371 | M modified |
|
371 | M modified | |
372 | A added |
|
372 | A added | |
373 | A copied |
|
373 | A copied | |
374 | R removed |
|
374 | R removed | |
375 | ! deleted |
|
375 | ! deleted | |
376 | ? unknown |
|
376 | ? unknown | |
377 |
|
377 | |||
378 | Run status with 2 different flags. |
|
378 | Run status with 2 different flags. | |
379 | Check if result is the same or different. |
|
379 | Check if result is the same or different. | |
380 | If result is not as expected, raise error |
|
380 | If result is not as expected, raise error | |
381 |
|
381 | |||
382 | $ assert() { |
|
382 | $ assert() { | |
383 | > hg status $1 > ../a |
|
383 | > hg status $1 > ../a | |
384 | > hg status $2 > ../b |
|
384 | > hg status $2 > ../b | |
385 | > if diff ../a ../b > /dev/null; then |
|
385 | > if diff ../a ../b > /dev/null; then | |
386 | > out=0 |
|
386 | > out=0 | |
387 | > else |
|
387 | > else | |
388 | > out=1 |
|
388 | > out=1 | |
389 | > fi |
|
389 | > fi | |
390 | > if [ $3 -eq 0 ]; then |
|
390 | > if [ $3 -eq 0 ]; then | |
391 | > df="same" |
|
391 | > df="same" | |
392 | > else |
|
392 | > else | |
393 | > df="different" |
|
393 | > df="different" | |
394 | > fi |
|
394 | > fi | |
395 | > if [ $out -ne $3 ]; then |
|
395 | > if [ $out -ne $3 ]; then | |
396 | > echo "Error on $1 and $2, should be $df." |
|
396 | > echo "Error on $1 and $2, should be $df." | |
397 | > fi |
|
397 | > fi | |
398 | > } |
|
398 | > } | |
399 |
|
399 | |||
400 | Assert flag1 flag2 [0-same | 1-different] |
|
400 | Assert flag1 flag2 [0-same | 1-different] | |
401 |
|
401 | |||
402 | $ assert "-q" "-mard" 0 |
|
402 | $ assert "-q" "-mard" 0 | |
403 | $ assert "-A" "-marduicC" 0 |
|
403 | $ assert "-A" "-marduicC" 0 | |
404 | $ assert "-qA" "-mardcC" 0 |
|
404 | $ assert "-qA" "-mardcC" 0 | |
405 | $ assert "-qAui" "-A" 0 |
|
405 | $ assert "-qAui" "-A" 0 | |
406 | $ assert "-qAu" "-marducC" 0 |
|
406 | $ assert "-qAu" "-marducC" 0 | |
407 | $ assert "-qAi" "-mardicC" 0 |
|
407 | $ assert "-qAi" "-mardicC" 0 | |
408 | $ assert "-qu" "-u" 0 |
|
408 | $ assert "-qu" "-u" 0 | |
409 | $ assert "-q" "-u" 1 |
|
409 | $ assert "-q" "-u" 1 | |
410 | $ assert "-m" "-a" 1 |
|
410 | $ assert "-m" "-a" 1 | |
411 | $ assert "-r" "-d" 1 |
|
411 | $ assert "-r" "-d" 1 | |
412 | $ cd .. |
|
412 | $ cd .. | |
413 |
|
413 | |||
414 | $ hg init repo4 |
|
414 | $ hg init repo4 | |
415 | $ cd repo4 |
|
415 | $ cd repo4 | |
416 | $ touch modified removed deleted |
|
416 | $ touch modified removed deleted | |
417 | $ hg ci -q -A -m 'initial checkin' |
|
417 | $ hg ci -q -A -m 'initial checkin' | |
418 | $ touch added unknown |
|
418 | $ touch added unknown | |
419 | $ hg add added |
|
419 | $ hg add added | |
420 | $ hg remove removed |
|
420 | $ hg remove removed | |
421 | $ rm deleted |
|
421 | $ rm deleted | |
422 | $ echo x > modified |
|
422 | $ echo x > modified | |
423 | $ hg copy modified copied |
|
423 | $ hg copy modified copied | |
424 | $ hg ci -m 'test checkin' -d "1000001 0" |
|
424 | $ hg ci -m 'test checkin' -d "1000001 0" | |
425 | $ rm * |
|
425 | $ rm * | |
426 | $ touch unrelated |
|
426 | $ touch unrelated | |
427 | $ hg ci -q -A -m 'unrelated checkin' -d "1000002 0" |
|
427 | $ hg ci -q -A -m 'unrelated checkin' -d "1000002 0" | |
428 |
|
428 | |||
429 | hg status --change 1: |
|
429 | hg status --change 1: | |
430 |
|
430 | |||
431 | $ hg status --change 1 |
|
431 | $ hg status --change 1 | |
432 | M modified |
|
432 | M modified | |
433 | A added |
|
433 | A added | |
434 | A copied |
|
434 | A copied | |
435 | R removed |
|
435 | R removed | |
436 |
|
436 | |||
437 | hg status --change 1 unrelated: |
|
437 | hg status --change 1 unrelated: | |
438 |
|
438 | |||
439 | $ hg status --change 1 unrelated |
|
439 | $ hg status --change 1 unrelated | |
440 |
|
440 | |||
441 | hg status -C --change 1 added modified copied removed deleted: |
|
441 | hg status -C --change 1 added modified copied removed deleted: | |
442 |
|
442 | |||
443 | $ hg status -C --change 1 added modified copied removed deleted |
|
443 | $ hg status -C --change 1 added modified copied removed deleted | |
444 | M modified |
|
444 | M modified | |
445 | A added |
|
445 | A added | |
446 | A copied |
|
446 | A copied | |
447 | modified |
|
447 | modified | |
448 | R removed |
|
448 | R removed | |
449 |
|
449 | |||
450 | hg status -A --change 1 and revset: |
|
450 | hg status -A --change 1 and revset: | |
451 |
|
451 | |||
452 | $ hg status -A --change '1|1' |
|
452 | $ hg status -A --change '1|1' | |
453 | M modified |
|
453 | M modified | |
454 | A added |
|
454 | A added | |
455 | A copied |
|
455 | A copied | |
456 | modified |
|
456 | modified | |
457 | R removed |
|
457 | R removed | |
458 | C deleted |
|
458 | C deleted | |
459 |
|
459 | |||
460 | $ cd .. |
|
460 | $ cd .. | |
461 |
|
461 | |||
462 | hg status with --rev and reverted changes: |
|
462 | hg status with --rev and reverted changes: | |
463 |
|
463 | |||
464 | $ hg init reverted-changes-repo |
|
464 | $ hg init reverted-changes-repo | |
465 | $ cd reverted-changes-repo |
|
465 | $ cd reverted-changes-repo | |
466 | $ echo a > file |
|
466 | $ echo a > file | |
467 | $ hg add file |
|
467 | $ hg add file | |
468 | $ hg ci -m a |
|
468 | $ hg ci -m a | |
469 | $ echo b > file |
|
469 | $ echo b > file | |
470 | $ hg ci -m b |
|
470 | $ hg ci -m b | |
471 |
|
471 | |||
472 | reverted file should appear clean |
|
472 | reverted file should appear clean | |
473 |
|
473 | |||
474 | $ hg revert -r 0 . |
|
474 | $ hg revert -r 0 . | |
475 | reverting file |
|
475 | reverting file | |
476 | $ hg status -A --rev 0 |
|
476 | $ hg status -A --rev 0 | |
477 | C file |
|
477 | C file | |
478 |
|
478 | |||
479 | #if execbit |
|
479 | #if execbit | |
480 | reverted file with changed flag should appear modified |
|
480 | reverted file with changed flag should appear modified | |
481 |
|
481 | |||
482 | $ chmod +x file |
|
482 | $ chmod +x file | |
483 | $ hg status -A --rev 0 |
|
483 | $ hg status -A --rev 0 | |
484 | M file |
|
484 | M file | |
485 |
|
485 | |||
486 | $ hg revert -r 0 . |
|
486 | $ hg revert -r 0 . | |
487 | reverting file |
|
487 | reverting file | |
488 |
|
488 | |||
489 | reverted and committed file with changed flag should appear modified |
|
489 | reverted and committed file with changed flag should appear modified | |
490 |
|
490 | |||
491 | $ hg co -C . |
|
491 | $ hg co -C . | |
492 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
492 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
493 | $ chmod +x file |
|
493 | $ chmod +x file | |
494 | $ hg ci -m 'change flag' |
|
494 | $ hg ci -m 'change flag' | |
495 | $ hg status -A --rev 1 --rev 2 |
|
495 | $ hg status -A --rev 1 --rev 2 | |
496 | M file |
|
496 | M file | |
497 | $ hg diff -r 1 -r 2 |
|
497 | $ hg diff -r 1 -r 2 | |
498 |
|
498 | |||
499 | #endif |
|
499 | #endif | |
500 |
|
500 | |||
501 | $ cd .. |
|
501 | $ cd .. | |
502 |
|
502 | |||
503 | hg status of binary file starting with '\1\n', a separator for metadata: |
|
503 | hg status of binary file starting with '\1\n', a separator for metadata: | |
504 |
|
504 | |||
505 | $ hg init repo5 |
|
505 | $ hg init repo5 | |
506 | $ cd repo5 |
|
506 | $ cd repo5 | |
507 | >>> open("010a", r"wb").write(b"\1\nfoo") and None |
|
507 | >>> open("010a", r"wb").write(b"\1\nfoo") and None | |
508 | $ hg ci -q -A -m 'initial checkin' |
|
508 | $ hg ci -q -A -m 'initial checkin' | |
509 | $ hg status -A |
|
509 | $ hg status -A | |
510 | C 010a |
|
510 | C 010a | |
511 |
|
511 | |||
512 | >>> open("010a", r"wb").write(b"\1\nbar") and None |
|
512 | >>> open("010a", r"wb").write(b"\1\nbar") and None | |
513 | $ hg status -A |
|
513 | $ hg status -A | |
514 | M 010a |
|
514 | M 010a | |
515 | $ hg ci -q -m 'modify 010a' |
|
515 | $ hg ci -q -m 'modify 010a' | |
516 | $ hg status -A --rev 0:1 |
|
516 | $ hg status -A --rev 0:1 | |
517 | M 010a |
|
517 | M 010a | |
518 |
|
518 | |||
519 | $ touch empty |
|
519 | $ touch empty | |
520 | $ hg ci -q -A -m 'add another file' |
|
520 | $ hg ci -q -A -m 'add another file' | |
521 | $ hg status -A --rev 1:2 010a |
|
521 | $ hg status -A --rev 1:2 010a | |
522 | C 010a |
|
522 | C 010a | |
523 |
|
523 | |||
524 | $ cd .. |
|
524 | $ cd .. | |
525 |
|
525 | |||
526 | test "hg status" with "directory pattern" which matches against files |
|
526 | test "hg status" with "directory pattern" which matches against files | |
527 | only known on target revision. |
|
527 | only known on target revision. | |
528 |
|
528 | |||
529 | $ hg init repo6 |
|
529 | $ hg init repo6 | |
530 | $ cd repo6 |
|
530 | $ cd repo6 | |
531 |
|
531 | |||
532 | $ echo a > a.txt |
|
532 | $ echo a > a.txt | |
533 | $ hg add a.txt |
|
533 | $ hg add a.txt | |
534 | $ hg commit -m '#0' |
|
534 | $ hg commit -m '#0' | |
535 | $ mkdir -p 1/2/3/4/5 |
|
535 | $ mkdir -p 1/2/3/4/5 | |
536 | $ echo b > 1/2/3/4/5/b.txt |
|
536 | $ echo b > 1/2/3/4/5/b.txt | |
537 | $ hg add 1/2/3/4/5/b.txt |
|
537 | $ hg add 1/2/3/4/5/b.txt | |
538 | $ hg commit -m '#1' |
|
538 | $ hg commit -m '#1' | |
539 |
|
539 | |||
540 | $ hg update -C 0 > /dev/null |
|
540 | $ hg update -C 0 > /dev/null | |
541 | $ hg status -A |
|
541 | $ hg status -A | |
542 | C a.txt |
|
542 | C a.txt | |
543 |
|
543 | |||
544 | the directory matching against specified pattern should be removed, |
|
544 | the directory matching against specified pattern should be removed, | |
545 | because directory existence prevents 'dirstate.walk()' from showing |
|
545 | because directory existence prevents 'dirstate.walk()' from showing | |
546 | warning message about such pattern. |
|
546 | warning message about such pattern. | |
547 |
|
547 | |||
548 | $ test ! -d 1 |
|
548 | $ test ! -d 1 | |
549 | $ hg status -A --rev 1 1/2/3/4/5/b.txt |
|
549 | $ hg status -A --rev 1 1/2/3/4/5/b.txt | |
550 | R 1/2/3/4/5/b.txt |
|
550 | R 1/2/3/4/5/b.txt | |
551 | $ hg status -A --rev 1 1/2/3/4/5 |
|
551 | $ hg status -A --rev 1 1/2/3/4/5 | |
552 | R 1/2/3/4/5/b.txt |
|
552 | R 1/2/3/4/5/b.txt | |
553 | $ hg status -A --rev 1 1/2/3 |
|
553 | $ hg status -A --rev 1 1/2/3 | |
554 | R 1/2/3/4/5/b.txt |
|
554 | R 1/2/3/4/5/b.txt | |
555 | $ hg status -A --rev 1 1 |
|
555 | $ hg status -A --rev 1 1 | |
556 | R 1/2/3/4/5/b.txt |
|
556 | R 1/2/3/4/5/b.txt | |
557 |
|
557 | |||
558 | $ hg status --config ui.formatdebug=True --rev 1 1 |
|
558 | $ hg status --config ui.formatdebug=True --rev 1 1 | |
559 | status = [ |
|
559 | status = [ | |
560 | { |
|
560 | { | |
561 | 'path': '1/2/3/4/5/b.txt', |
|
561 | 'path': '1/2/3/4/5/b.txt', | |
562 | 'status': 'R' |
|
562 | 'status': 'R' | |
563 | }, |
|
563 | }, | |
564 | ] |
|
564 | ] | |
565 |
|
565 | |||
566 | #if windows |
|
566 | #if windows | |
567 | $ hg --config ui.slash=false status -A --rev 1 1 |
|
567 | $ hg --config ui.slash=false status -A --rev 1 1 | |
568 | R 1\2\3\4\5\b.txt |
|
568 | R 1\2\3\4\5\b.txt | |
569 | #endif |
|
569 | #endif | |
570 |
|
570 | |||
571 | $ cd .. |
|
571 | $ cd .. | |
572 |
|
572 | |||
573 | Status after move overwriting a file (issue4458) |
|
573 | Status after move overwriting a file (issue4458) | |
574 | ================================================= |
|
574 | ================================================= | |
575 |
|
575 | |||
576 |
|
576 | |||
577 | $ hg init issue4458 |
|
577 | $ hg init issue4458 | |
578 | $ cd issue4458 |
|
578 | $ cd issue4458 | |
579 | $ echo a > a |
|
579 | $ echo a > a | |
580 | $ echo b > b |
|
580 | $ echo b > b | |
581 | $ hg commit -Am base |
|
581 | $ hg commit -Am base | |
582 | adding a |
|
582 | adding a | |
583 | adding b |
|
583 | adding b | |
584 |
|
584 | |||
585 |
|
585 | |||
586 | with --force |
|
586 | with --force | |
587 |
|
587 | |||
588 | $ hg mv b --force a |
|
588 | $ hg mv b --force a | |
589 | $ hg st --copies |
|
589 | $ hg st --copies | |
590 | M a |
|
590 | M a | |
591 | b |
|
591 | b | |
592 | R b |
|
592 | R b | |
593 | $ hg revert --all |
|
593 | $ hg revert --all | |
594 | reverting a |
|
594 | reverting a | |
595 | undeleting b |
|
595 | undeleting b | |
596 | $ rm *.orig |
|
596 | $ rm *.orig | |
597 |
|
597 | |||
598 | without force |
|
598 | without force | |
599 |
|
599 | |||
600 | $ hg rm a |
|
600 | $ hg rm a | |
601 | $ hg st --copies |
|
601 | $ hg st --copies | |
602 | R a |
|
602 | R a | |
603 | $ hg mv b a |
|
603 | $ hg mv b a | |
604 | $ hg st --copies |
|
604 | $ hg st --copies | |
605 | M a |
|
605 | M a | |
606 | b |
|
606 | b | |
607 | R b |
|
607 | R b | |
608 |
|
608 | |||
609 | using ui.statuscopies setting |
|
609 | using ui.statuscopies setting | |
610 | $ hg st --config ui.statuscopies=true |
|
610 | $ hg st --config ui.statuscopies=true | |
611 | M a |
|
611 | M a | |
612 | b |
|
612 | b | |
613 | R b |
|
613 | R b | |
614 | $ hg st --config ui.statuscopies=false |
|
614 | $ hg st --config ui.statuscopies=false | |
615 | M a |
|
615 | M a | |
616 | R b |
|
616 | R b | |
617 | $ hg st --config ui.tweakdefaults=yes |
|
617 | $ hg st --config ui.tweakdefaults=yes | |
618 | M a |
|
618 | M a | |
619 | b |
|
619 | b | |
620 | R b |
|
620 | R b | |
621 |
|
621 | |||
622 | using log status template (issue5155) |
|
622 | using log status template (issue5155) | |
623 | $ hg log -Tstatus -r 'wdir()' -C |
|
623 | $ hg log -Tstatus -r 'wdir()' -C | |
624 | changeset: 2147483647:ffffffffffff |
|
624 | changeset: 2147483647:ffffffffffff | |
625 | parent: 0:8c55c58b4c0e |
|
625 | parent: 0:8c55c58b4c0e | |
626 | user: test |
|
626 | user: test | |
627 | date: * (glob) |
|
627 | date: * (glob) | |
628 | files: |
|
628 | files: | |
629 | M a |
|
629 | M a | |
630 | b |
|
630 | b | |
631 | R b |
|
631 | R b | |
632 |
|
632 | |||
|
633 | BROKEN: as above, 'a' should be marked a copy | |||
|
634 | $ hg log -GTstatus -r 'wdir()' -C | |||
|
635 | o changeset: 2147483647:ffffffffffff | |||
|
636 | | parent: 0:8c55c58b4c0e | |||
|
637 | ~ user: test | |||
|
638 | date: * (glob) | |||
|
639 | files: | |||
|
640 | M a | |||
|
641 | R b | |||
|
642 | ||||
633 |
|
643 | |||
634 | Other "bug" highlight, the revision status does not report the copy information. |
|
644 | Other "bug" highlight, the revision status does not report the copy information. | |
635 | This is buggy behavior. |
|
645 | This is buggy behavior. | |
636 |
|
646 | |||
637 | $ hg commit -m 'blah' |
|
647 | $ hg commit -m 'blah' | |
638 | $ hg st --copies --change . |
|
648 | $ hg st --copies --change . | |
639 | M a |
|
649 | M a | |
640 | R b |
|
650 | R b | |
641 |
|
651 | |||
642 | using log status template, the copy information is displayed correctly. |
|
652 | using log status template, the copy information is displayed correctly. | |
643 | $ hg log -Tstatus -r. -C |
|
653 | $ hg log -Tstatus -r. -C | |
644 | changeset: 1:6685fde43d21 |
|
654 | changeset: 1:6685fde43d21 | |
645 | tag: tip |
|
655 | tag: tip | |
646 | user: test |
|
656 | user: test | |
647 | date: * (glob) |
|
657 | date: * (glob) | |
648 | summary: blah |
|
658 | summary: blah | |
649 | files: |
|
659 | files: | |
650 | M a |
|
660 | M a | |
651 | b |
|
661 | b | |
652 | R b |
|
662 | R b | |
653 |
|
663 | |||
654 |
|
664 | |||
655 | $ cd .. |
|
665 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now