Show More
@@ -1,25 +1,20 b'' | |||||
1 | %include map-cmdline.default |
|
1 | %include map-cmdline.default | |
2 |
|
2 | |||
3 | # Override base templates |
|
3 | # Override base templates | |
4 | changeset = '{cset}{branches}{bookmarks}{tags}{parents}{user}{ldate}{summary}{lfiles}\n' |
|
4 | changeset = '{cset}{branches}{bookmarks}{tags}{parents}{user}{ldate}{summary}{lfiles}\n' | |
5 | changeset_verbose = '{cset}{branches}{bookmarks}{tags}{parents}{user}{ldate}{description}{lfiles}\n' |
|
5 | changeset_verbose = '{cset}{branches}{bookmarks}{tags}{parents}{user}{ldate}{description}{lfiles}\n' | |
6 | changeset_debug = '{fullcset}{branches}{bookmarks}{tags}{lphase}{parents}{manifest}{user}{ldate}{extras}{description}{lfiles}\n' |
|
6 | changeset_debug = '{fullcset}{branches}{bookmarks}{tags}{lphase}{parents}{manifest}{user}{ldate}{extras}{description}{lfiles}\n' | |
7 |
|
7 | |||
8 | # Override the file templates |
|
8 | # Override the file templates | |
9 | lfiles = '{if(files, |
|
9 | lfiles = '{if(files, | |
10 | label('ui.note log.files', |
|
10 | label('ui.note log.files', | |
11 |
'files:\n'))}{lfile_mods}{lfile_adds}{lfile_ |
|
11 | 'files:\n'))}{lfile_mods}{lfile_adds}{lfile_dels}' | |
12 |
|
12 | |||
13 | # Exclude copied files, will display those in lfile_copies_switch |
|
13 | lfile_adds = '{file_adds % "{lfile_add}{lfile_src}"}' | |
14 |
lfile_ |
|
14 | lfile_mods = '{file_mods % "{lfile_mod}{lfile_src}"}' | |
15 | '', |
|
|||
16 | '{lfile_add}')}"}' |
|
|||
17 | lfile_add = '{label("status.added", "A {file}\n")}' |
|
15 | lfile_add = '{label("status.added", "A {file}\n")}' | |
18 |
|
16 | lfile_mod = '{label("status.modified", "M {file}\n")}' | ||
19 | lfile_copies_switch = '{file_copies_switch % "{lfile_copy_orig}{lfile_copy_dest}"}' |
|
17 | lfile_src = '{ifcontains(file, file_copies_switch, | |
20 | lfile_copy_orig = '{label("status.added", "A {name}\n")}' |
|
18 | label("status.copied", " {get(file_copies_switch, file)}\n"))}' | |
21 | lfile_copy_dest = '{label("status.copied", " {source}\n")}' |
|
|||
22 |
|
||||
23 | lfile_mods = '{file_mods % "{label('status.modified', 'M {file}\n')}"}' |
|
|||
24 |
|
19 | |||
25 | lfile_dels = '{file_dels % "{label('status.removed', 'R {file}\n')}"}' |
|
20 | lfile_dels = '{file_dels % "{label('status.removed', 'R {file}\n')}"}' |
@@ -1,524 +1,549 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 | $ cd .. |
|
110 | $ cd .. | |
111 |
|
111 | |||
112 | $ hg init repo2 |
|
112 | $ hg init repo2 | |
113 | $ cd repo2 |
|
113 | $ cd repo2 | |
114 | $ touch modified removed deleted ignored |
|
114 | $ touch modified removed deleted ignored | |
115 | $ echo "^ignored$" > .hgignore |
|
115 | $ echo "^ignored$" > .hgignore | |
116 | $ hg ci -A -m 'initial checkin' |
|
116 | $ hg ci -A -m 'initial checkin' | |
117 | adding .hgignore |
|
117 | adding .hgignore | |
118 | adding deleted |
|
118 | adding deleted | |
119 | adding modified |
|
119 | adding modified | |
120 | adding removed |
|
120 | adding removed | |
121 | $ touch modified added unknown ignored |
|
121 | $ touch modified added unknown ignored | |
122 | $ hg add added |
|
122 | $ hg add added | |
123 | $ hg remove removed |
|
123 | $ hg remove removed | |
124 | $ rm deleted |
|
124 | $ rm deleted | |
125 |
|
125 | |||
126 | hg status: |
|
126 | hg status: | |
127 |
|
127 | |||
128 | $ hg status |
|
128 | $ hg status | |
129 | A added |
|
129 | A added | |
130 | R removed |
|
130 | R removed | |
131 | ! deleted |
|
131 | ! deleted | |
132 | ? unknown |
|
132 | ? unknown | |
133 |
|
133 | |||
134 | hg status modified added removed deleted unknown never-existed ignored: |
|
134 | hg status modified added removed deleted unknown never-existed ignored: | |
135 |
|
135 | |||
136 | $ hg status modified added removed deleted unknown never-existed ignored |
|
136 | $ hg status modified added removed deleted unknown never-existed ignored | |
137 | never-existed: * (glob) |
|
137 | never-existed: * (glob) | |
138 | A added |
|
138 | A added | |
139 | R removed |
|
139 | R removed | |
140 | ! deleted |
|
140 | ! deleted | |
141 | ? unknown |
|
141 | ? unknown | |
142 |
|
142 | |||
143 | $ hg copy modified copied |
|
143 | $ hg copy modified copied | |
144 |
|
144 | |||
145 | hg status -C: |
|
145 | hg status -C: | |
146 |
|
146 | |||
147 | $ hg status -C |
|
147 | $ hg status -C | |
148 | A added |
|
148 | A added | |
149 | A copied |
|
149 | A copied | |
150 | modified |
|
150 | modified | |
151 | R removed |
|
151 | R removed | |
152 | ! deleted |
|
152 | ! deleted | |
153 | ? unknown |
|
153 | ? unknown | |
154 |
|
154 | |||
155 | hg status -A: |
|
155 | hg status -A: | |
156 |
|
156 | |||
157 | $ hg status -A |
|
157 | $ hg status -A | |
158 | A added |
|
158 | A added | |
159 | A copied |
|
159 | A copied | |
160 | modified |
|
160 | modified | |
161 | R removed |
|
161 | R removed | |
162 | ! deleted |
|
162 | ! deleted | |
163 | ? unknown |
|
163 | ? unknown | |
164 | I ignored |
|
164 | I ignored | |
165 | C .hgignore |
|
165 | C .hgignore | |
166 | C modified |
|
166 | C modified | |
167 |
|
167 | |||
168 | $ hg status -A -Tjson |
|
168 | $ hg status -A -Tjson | |
169 | [ |
|
169 | [ | |
170 | { |
|
170 | { | |
171 | "path": "added", |
|
171 | "path": "added", | |
172 | "status": "A" |
|
172 | "status": "A" | |
173 | }, |
|
173 | }, | |
174 | { |
|
174 | { | |
175 | "copy": "modified", |
|
175 | "copy": "modified", | |
176 | "path": "copied", |
|
176 | "path": "copied", | |
177 | "status": "A" |
|
177 | "status": "A" | |
178 | }, |
|
178 | }, | |
179 | { |
|
179 | { | |
180 | "path": "removed", |
|
180 | "path": "removed", | |
181 | "status": "R" |
|
181 | "status": "R" | |
182 | }, |
|
182 | }, | |
183 | { |
|
183 | { | |
184 | "path": "deleted", |
|
184 | "path": "deleted", | |
185 | "status": "!" |
|
185 | "status": "!" | |
186 | }, |
|
186 | }, | |
187 | { |
|
187 | { | |
188 | "path": "unknown", |
|
188 | "path": "unknown", | |
189 | "status": "?" |
|
189 | "status": "?" | |
190 | }, |
|
190 | }, | |
191 | { |
|
191 | { | |
192 | "path": "ignored", |
|
192 | "path": "ignored", | |
193 | "status": "I" |
|
193 | "status": "I" | |
194 | }, |
|
194 | }, | |
195 | { |
|
195 | { | |
196 | "path": ".hgignore", |
|
196 | "path": ".hgignore", | |
197 | "status": "C" |
|
197 | "status": "C" | |
198 | }, |
|
198 | }, | |
199 | { |
|
199 | { | |
200 | "path": "modified", |
|
200 | "path": "modified", | |
201 | "status": "C" |
|
201 | "status": "C" | |
202 | } |
|
202 | } | |
203 | ] |
|
203 | ] | |
204 |
|
204 | |||
205 | $ hg status -A -Tpickle > pickle |
|
205 | $ hg status -A -Tpickle > pickle | |
206 | >>> import pickle |
|
206 | >>> import pickle | |
207 | >>> print sorted((x['status'], x['path']) for x in pickle.load(open("pickle"))) |
|
207 | >>> print sorted((x['status'], x['path']) for x in pickle.load(open("pickle"))) | |
208 | [('!', 'deleted'), ('?', 'pickle'), ('?', 'unknown'), ('A', 'added'), ('A', 'copied'), ('C', '.hgignore'), ('C', 'modified'), ('I', 'ignored'), ('R', 'removed')] |
|
208 | [('!', 'deleted'), ('?', 'pickle'), ('?', 'unknown'), ('A', 'added'), ('A', 'copied'), ('C', '.hgignore'), ('C', 'modified'), ('I', 'ignored'), ('R', 'removed')] | |
209 | $ rm pickle |
|
209 | $ rm pickle | |
210 |
|
210 | |||
211 | $ echo "^ignoreddir$" > .hgignore |
|
211 | $ echo "^ignoreddir$" > .hgignore | |
212 | $ mkdir ignoreddir |
|
212 | $ mkdir ignoreddir | |
213 | $ touch ignoreddir/file |
|
213 | $ touch ignoreddir/file | |
214 |
|
214 | |||
215 | Test templater support: |
|
215 | Test templater support: | |
216 |
|
216 | |||
217 | $ hg status -AT "[{status}]\t{if(copy, '{copy} -> ')}{path}\n" |
|
217 | $ hg status -AT "[{status}]\t{if(copy, '{copy} -> ')}{path}\n" | |
218 | [M] .hgignore |
|
218 | [M] .hgignore | |
219 | [A] added |
|
219 | [A] added | |
220 | [A] modified -> copied |
|
220 | [A] modified -> copied | |
221 | [R] removed |
|
221 | [R] removed | |
222 | [!] deleted |
|
222 | [!] deleted | |
223 | [?] ignored |
|
223 | [?] ignored | |
224 | [?] unknown |
|
224 | [?] unknown | |
225 | [I] ignoreddir/file |
|
225 | [I] ignoreddir/file | |
226 | [C] modified |
|
226 | [C] modified | |
227 | $ hg status -AT default |
|
227 | $ hg status -AT default | |
228 | M .hgignore |
|
228 | M .hgignore | |
229 | A added |
|
229 | A added | |
230 | A copied |
|
230 | A copied | |
231 | modified |
|
231 | modified | |
232 | R removed |
|
232 | R removed | |
233 | ! deleted |
|
233 | ! deleted | |
234 | ? ignored |
|
234 | ? ignored | |
235 | ? unknown |
|
235 | ? unknown | |
236 | I ignoreddir/file |
|
236 | I ignoreddir/file | |
237 | C modified |
|
237 | C modified | |
238 | $ hg status -T compact |
|
238 | $ hg status -T compact | |
239 | abort: "status" not in template map |
|
239 | abort: "status" not in template map | |
240 | [255] |
|
240 | [255] | |
241 |
|
241 | |||
242 | hg status ignoreddir/file: |
|
242 | hg status ignoreddir/file: | |
243 |
|
243 | |||
244 | $ hg status ignoreddir/file |
|
244 | $ hg status ignoreddir/file | |
245 |
|
245 | |||
246 | hg status -i ignoreddir/file: |
|
246 | hg status -i ignoreddir/file: | |
247 |
|
247 | |||
248 | $ hg status -i ignoreddir/file |
|
248 | $ hg status -i ignoreddir/file | |
249 | I ignoreddir/file |
|
249 | I ignoreddir/file | |
250 | $ cd .. |
|
250 | $ cd .. | |
251 |
|
251 | |||
252 | Check 'status -q' and some combinations |
|
252 | Check 'status -q' and some combinations | |
253 |
|
253 | |||
254 | $ hg init repo3 |
|
254 | $ hg init repo3 | |
255 | $ cd repo3 |
|
255 | $ cd repo3 | |
256 | $ touch modified removed deleted ignored |
|
256 | $ touch modified removed deleted ignored | |
257 | $ echo "^ignored$" > .hgignore |
|
257 | $ echo "^ignored$" > .hgignore | |
258 | $ hg commit -A -m 'initial checkin' |
|
258 | $ hg commit -A -m 'initial checkin' | |
259 | adding .hgignore |
|
259 | adding .hgignore | |
260 | adding deleted |
|
260 | adding deleted | |
261 | adding modified |
|
261 | adding modified | |
262 | adding removed |
|
262 | adding removed | |
263 | $ touch added unknown ignored |
|
263 | $ touch added unknown ignored | |
264 | $ hg add added |
|
264 | $ hg add added | |
265 | $ echo "test" >> modified |
|
265 | $ echo "test" >> modified | |
266 | $ hg remove removed |
|
266 | $ hg remove removed | |
267 | $ rm deleted |
|
267 | $ rm deleted | |
268 | $ hg copy modified copied |
|
268 | $ hg copy modified copied | |
269 |
|
269 | |||
270 | Specify working directory revision explicitly, that should be the same as |
|
270 | Specify working directory revision explicitly, that should be the same as | |
271 | "hg status" |
|
271 | "hg status" | |
272 |
|
272 | |||
273 | $ hg status --change "wdir()" |
|
273 | $ hg status --change "wdir()" | |
274 | M modified |
|
274 | M modified | |
275 | A added |
|
275 | A added | |
276 | A copied |
|
276 | A copied | |
277 | R removed |
|
277 | R removed | |
278 | ! deleted |
|
278 | ! deleted | |
279 | ? unknown |
|
279 | ? unknown | |
280 |
|
280 | |||
281 | Run status with 2 different flags. |
|
281 | Run status with 2 different flags. | |
282 | Check if result is the same or different. |
|
282 | Check if result is the same or different. | |
283 | If result is not as expected, raise error |
|
283 | If result is not as expected, raise error | |
284 |
|
284 | |||
285 | $ assert() { |
|
285 | $ assert() { | |
286 | > hg status $1 > ../a |
|
286 | > hg status $1 > ../a | |
287 | > hg status $2 > ../b |
|
287 | > hg status $2 > ../b | |
288 | > if diff ../a ../b > /dev/null; then |
|
288 | > if diff ../a ../b > /dev/null; then | |
289 | > out=0 |
|
289 | > out=0 | |
290 | > else |
|
290 | > else | |
291 | > out=1 |
|
291 | > out=1 | |
292 | > fi |
|
292 | > fi | |
293 | > if [ $3 -eq 0 ]; then |
|
293 | > if [ $3 -eq 0 ]; then | |
294 | > df="same" |
|
294 | > df="same" | |
295 | > else |
|
295 | > else | |
296 | > df="different" |
|
296 | > df="different" | |
297 | > fi |
|
297 | > fi | |
298 | > if [ $out -ne $3 ]; then |
|
298 | > if [ $out -ne $3 ]; then | |
299 | > echo "Error on $1 and $2, should be $df." |
|
299 | > echo "Error on $1 and $2, should be $df." | |
300 | > fi |
|
300 | > fi | |
301 | > } |
|
301 | > } | |
302 |
|
302 | |||
303 | Assert flag1 flag2 [0-same | 1-different] |
|
303 | Assert flag1 flag2 [0-same | 1-different] | |
304 |
|
304 | |||
305 | $ assert "-q" "-mard" 0 |
|
305 | $ assert "-q" "-mard" 0 | |
306 | $ assert "-A" "-marduicC" 0 |
|
306 | $ assert "-A" "-marduicC" 0 | |
307 | $ assert "-qA" "-mardcC" 0 |
|
307 | $ assert "-qA" "-mardcC" 0 | |
308 | $ assert "-qAui" "-A" 0 |
|
308 | $ assert "-qAui" "-A" 0 | |
309 | $ assert "-qAu" "-marducC" 0 |
|
309 | $ assert "-qAu" "-marducC" 0 | |
310 | $ assert "-qAi" "-mardicC" 0 |
|
310 | $ assert "-qAi" "-mardicC" 0 | |
311 | $ assert "-qu" "-u" 0 |
|
311 | $ assert "-qu" "-u" 0 | |
312 | $ assert "-q" "-u" 1 |
|
312 | $ assert "-q" "-u" 1 | |
313 | $ assert "-m" "-a" 1 |
|
313 | $ assert "-m" "-a" 1 | |
314 | $ assert "-r" "-d" 1 |
|
314 | $ assert "-r" "-d" 1 | |
315 | $ cd .. |
|
315 | $ cd .. | |
316 |
|
316 | |||
317 | $ hg init repo4 |
|
317 | $ hg init repo4 | |
318 | $ cd repo4 |
|
318 | $ cd repo4 | |
319 | $ touch modified removed deleted |
|
319 | $ touch modified removed deleted | |
320 | $ hg ci -q -A -m 'initial checkin' |
|
320 | $ hg ci -q -A -m 'initial checkin' | |
321 | $ touch added unknown |
|
321 | $ touch added unknown | |
322 | $ hg add added |
|
322 | $ hg add added | |
323 | $ hg remove removed |
|
323 | $ hg remove removed | |
324 | $ rm deleted |
|
324 | $ rm deleted | |
325 | $ echo x > modified |
|
325 | $ echo x > modified | |
326 | $ hg copy modified copied |
|
326 | $ hg copy modified copied | |
327 | $ hg ci -m 'test checkin' -d "1000001 0" |
|
327 | $ hg ci -m 'test checkin' -d "1000001 0" | |
328 | $ rm * |
|
328 | $ rm * | |
329 | $ touch unrelated |
|
329 | $ touch unrelated | |
330 | $ hg ci -q -A -m 'unrelated checkin' -d "1000002 0" |
|
330 | $ hg ci -q -A -m 'unrelated checkin' -d "1000002 0" | |
331 |
|
331 | |||
332 | hg status --change 1: |
|
332 | hg status --change 1: | |
333 |
|
333 | |||
334 | $ hg status --change 1 |
|
334 | $ hg status --change 1 | |
335 | M modified |
|
335 | M modified | |
336 | A added |
|
336 | A added | |
337 | A copied |
|
337 | A copied | |
338 | R removed |
|
338 | R removed | |
339 |
|
339 | |||
340 | hg status --change 1 unrelated: |
|
340 | hg status --change 1 unrelated: | |
341 |
|
341 | |||
342 | $ hg status --change 1 unrelated |
|
342 | $ hg status --change 1 unrelated | |
343 |
|
343 | |||
344 | hg status -C --change 1 added modified copied removed deleted: |
|
344 | hg status -C --change 1 added modified copied removed deleted: | |
345 |
|
345 | |||
346 | $ hg status -C --change 1 added modified copied removed deleted |
|
346 | $ hg status -C --change 1 added modified copied removed deleted | |
347 | M modified |
|
347 | M modified | |
348 | A added |
|
348 | A added | |
349 | A copied |
|
349 | A copied | |
350 | modified |
|
350 | modified | |
351 | R removed |
|
351 | R removed | |
352 |
|
352 | |||
353 | hg status -A --change 1 and revset: |
|
353 | hg status -A --change 1 and revset: | |
354 |
|
354 | |||
355 | $ hg status -A --change '1|1' |
|
355 | $ hg status -A --change '1|1' | |
356 | M modified |
|
356 | M modified | |
357 | A added |
|
357 | A added | |
358 | A copied |
|
358 | A copied | |
359 | modified |
|
359 | modified | |
360 | R removed |
|
360 | R removed | |
361 | C deleted |
|
361 | C deleted | |
362 |
|
362 | |||
363 | $ cd .. |
|
363 | $ cd .. | |
364 |
|
364 | |||
365 | hg status with --rev and reverted changes: |
|
365 | hg status with --rev and reverted changes: | |
366 |
|
366 | |||
367 | $ hg init reverted-changes-repo |
|
367 | $ hg init reverted-changes-repo | |
368 | $ cd reverted-changes-repo |
|
368 | $ cd reverted-changes-repo | |
369 | $ echo a > file |
|
369 | $ echo a > file | |
370 | $ hg add file |
|
370 | $ hg add file | |
371 | $ hg ci -m a |
|
371 | $ hg ci -m a | |
372 | $ echo b > file |
|
372 | $ echo b > file | |
373 | $ hg ci -m b |
|
373 | $ hg ci -m b | |
374 |
|
374 | |||
375 | reverted file should appear clean |
|
375 | reverted file should appear clean | |
376 |
|
376 | |||
377 | $ hg revert -r 0 . |
|
377 | $ hg revert -r 0 . | |
378 | reverting file |
|
378 | reverting file | |
379 | $ hg status -A --rev 0 |
|
379 | $ hg status -A --rev 0 | |
380 | C file |
|
380 | C file | |
381 |
|
381 | |||
382 | #if execbit |
|
382 | #if execbit | |
383 | reverted file with changed flag should appear modified |
|
383 | reverted file with changed flag should appear modified | |
384 |
|
384 | |||
385 | $ chmod +x file |
|
385 | $ chmod +x file | |
386 | $ hg status -A --rev 0 |
|
386 | $ hg status -A --rev 0 | |
387 | M file |
|
387 | M file | |
388 |
|
388 | |||
389 | $ hg revert -r 0 . |
|
389 | $ hg revert -r 0 . | |
390 | reverting file |
|
390 | reverting file | |
391 |
|
391 | |||
392 | reverted and committed file with changed flag should appear modified |
|
392 | reverted and committed file with changed flag should appear modified | |
393 |
|
393 | |||
394 | $ hg co -C . |
|
394 | $ hg co -C . | |
395 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
395 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
396 | $ chmod +x file |
|
396 | $ chmod +x file | |
397 | $ hg ci -m 'change flag' |
|
397 | $ hg ci -m 'change flag' | |
398 | $ hg status -A --rev 1 --rev 2 |
|
398 | $ hg status -A --rev 1 --rev 2 | |
399 | M file |
|
399 | M file | |
400 | $ hg diff -r 1 -r 2 |
|
400 | $ hg diff -r 1 -r 2 | |
401 |
|
401 | |||
402 | #endif |
|
402 | #endif | |
403 |
|
403 | |||
404 | hg status of binary file starting with '\1\n', a separator for metadata: |
|
404 | hg status of binary file starting with '\1\n', a separator for metadata: | |
405 |
|
405 | |||
406 | $ hg init repo5 |
|
406 | $ hg init repo5 | |
407 | $ cd repo5 |
|
407 | $ cd repo5 | |
408 | >>> open("010a", "wb").write("\1\nfoo") |
|
408 | >>> open("010a", "wb").write("\1\nfoo") | |
409 | $ hg ci -q -A -m 'initial checkin' |
|
409 | $ hg ci -q -A -m 'initial checkin' | |
410 | $ hg status -A |
|
410 | $ hg status -A | |
411 | C 010a |
|
411 | C 010a | |
412 |
|
412 | |||
413 | >>> open("010a", "wb").write("\1\nbar") |
|
413 | >>> open("010a", "wb").write("\1\nbar") | |
414 | $ hg status -A |
|
414 | $ hg status -A | |
415 | M 010a |
|
415 | M 010a | |
416 | $ hg ci -q -m 'modify 010a' |
|
416 | $ hg ci -q -m 'modify 010a' | |
417 | $ hg status -A --rev 0:1 |
|
417 | $ hg status -A --rev 0:1 | |
418 | M 010a |
|
418 | M 010a | |
419 |
|
419 | |||
420 | $ touch empty |
|
420 | $ touch empty | |
421 | $ hg ci -q -A -m 'add another file' |
|
421 | $ hg ci -q -A -m 'add another file' | |
422 | $ hg status -A --rev 1:2 010a |
|
422 | $ hg status -A --rev 1:2 010a | |
423 | C 010a |
|
423 | C 010a | |
424 |
|
424 | |||
425 | $ cd .. |
|
425 | $ cd .. | |
426 |
|
426 | |||
427 | test "hg status" with "directory pattern" which matches against files |
|
427 | test "hg status" with "directory pattern" which matches against files | |
428 | only known on target revision. |
|
428 | only known on target revision. | |
429 |
|
429 | |||
430 | $ hg init repo6 |
|
430 | $ hg init repo6 | |
431 | $ cd repo6 |
|
431 | $ cd repo6 | |
432 |
|
432 | |||
433 | $ echo a > a.txt |
|
433 | $ echo a > a.txt | |
434 | $ hg add a.txt |
|
434 | $ hg add a.txt | |
435 | $ hg commit -m '#0' |
|
435 | $ hg commit -m '#0' | |
436 | $ mkdir -p 1/2/3/4/5 |
|
436 | $ mkdir -p 1/2/3/4/5 | |
437 | $ echo b > 1/2/3/4/5/b.txt |
|
437 | $ echo b > 1/2/3/4/5/b.txt | |
438 | $ hg add 1/2/3/4/5/b.txt |
|
438 | $ hg add 1/2/3/4/5/b.txt | |
439 | $ hg commit -m '#1' |
|
439 | $ hg commit -m '#1' | |
440 |
|
440 | |||
441 | $ hg update -C 0 > /dev/null |
|
441 | $ hg update -C 0 > /dev/null | |
442 | $ hg status -A |
|
442 | $ hg status -A | |
443 | C a.txt |
|
443 | C a.txt | |
444 |
|
444 | |||
445 | the directory matching against specified pattern should be removed, |
|
445 | the directory matching against specified pattern should be removed, | |
446 | because directory existence prevents 'dirstate.walk()' from showing |
|
446 | because directory existence prevents 'dirstate.walk()' from showing | |
447 | warning message about such pattern. |
|
447 | warning message about such pattern. | |
448 |
|
448 | |||
449 | $ test ! -d 1 |
|
449 | $ test ! -d 1 | |
450 | $ hg status -A --rev 1 1/2/3/4/5/b.txt |
|
450 | $ hg status -A --rev 1 1/2/3/4/5/b.txt | |
451 | R 1/2/3/4/5/b.txt |
|
451 | R 1/2/3/4/5/b.txt | |
452 | $ hg status -A --rev 1 1/2/3/4/5 |
|
452 | $ hg status -A --rev 1 1/2/3/4/5 | |
453 | R 1/2/3/4/5/b.txt |
|
453 | R 1/2/3/4/5/b.txt | |
454 | $ hg status -A --rev 1 1/2/3 |
|
454 | $ hg status -A --rev 1 1/2/3 | |
455 | R 1/2/3/4/5/b.txt |
|
455 | R 1/2/3/4/5/b.txt | |
456 | $ hg status -A --rev 1 1 |
|
456 | $ hg status -A --rev 1 1 | |
457 | R 1/2/3/4/5/b.txt |
|
457 | R 1/2/3/4/5/b.txt | |
458 |
|
458 | |||
459 | $ hg status --config ui.formatdebug=True --rev 1 1 |
|
459 | $ hg status --config ui.formatdebug=True --rev 1 1 | |
460 | status = [ |
|
460 | status = [ | |
461 | {*'path': '1/2/3/4/5/b.txt'*}, (glob) |
|
461 | {*'path': '1/2/3/4/5/b.txt'*}, (glob) | |
462 | ] |
|
462 | ] | |
463 |
|
463 | |||
464 | #if windows |
|
464 | #if windows | |
465 | $ hg --config ui.slash=false status -A --rev 1 1 |
|
465 | $ hg --config ui.slash=false status -A --rev 1 1 | |
466 | R 1\2\3\4\5\b.txt |
|
466 | R 1\2\3\4\5\b.txt | |
467 | #endif |
|
467 | #endif | |
468 |
|
468 | |||
469 | $ cd .. |
|
469 | $ cd .. | |
470 |
|
470 | |||
471 | Status after move overwriting a file (issue4458) |
|
471 | Status after move overwriting a file (issue4458) | |
472 | ================================================= |
|
472 | ================================================= | |
473 |
|
473 | |||
474 |
|
474 | |||
475 | $ hg init issue4458 |
|
475 | $ hg init issue4458 | |
476 | $ cd issue4458 |
|
476 | $ cd issue4458 | |
477 | $ echo a > a |
|
477 | $ echo a > a | |
478 | $ echo b > b |
|
478 | $ echo b > b | |
479 | $ hg commit -Am base |
|
479 | $ hg commit -Am base | |
480 | adding a |
|
480 | adding a | |
481 | adding b |
|
481 | adding b | |
482 |
|
482 | |||
483 |
|
483 | |||
484 | with --force |
|
484 | with --force | |
485 |
|
485 | |||
486 | $ hg mv b --force a |
|
486 | $ hg mv b --force a | |
487 | $ hg st --copies |
|
487 | $ hg st --copies | |
488 | M a |
|
488 | M a | |
489 | b |
|
489 | b | |
490 | R b |
|
490 | R b | |
491 | $ hg revert --all |
|
491 | $ hg revert --all | |
492 | reverting a |
|
492 | reverting a | |
493 | undeleting b |
|
493 | undeleting b | |
494 | $ rm *.orig |
|
494 | $ rm *.orig | |
495 |
|
495 | |||
496 | without force |
|
496 | without force | |
497 |
|
497 | |||
498 | $ hg rm a |
|
498 | $ hg rm a | |
499 | $ hg st --copies |
|
499 | $ hg st --copies | |
500 | R a |
|
500 | R a | |
501 | $ hg mv b a |
|
501 | $ hg mv b a | |
502 | $ hg st --copies |
|
502 | $ hg st --copies | |
503 | M a |
|
503 | M a | |
504 | b |
|
504 | b | |
505 | R b |
|
505 | R b | |
506 |
|
506 | |||
507 | using ui.statuscopies setting |
|
507 | using ui.statuscopies setting | |
508 | $ hg st --config ui.statuscopies=true |
|
508 | $ hg st --config ui.statuscopies=true | |
509 | M a |
|
509 | M a | |
510 | b |
|
510 | b | |
511 | R b |
|
511 | R b | |
512 | $ hg st --config ui.statuscopies=false |
|
512 | $ hg st --config ui.statuscopies=false | |
513 | M a |
|
513 | M a | |
514 | R b |
|
514 | R b | |
515 |
|
515 | |||
|
516 | using log status template (issue5155) | |||
|
517 | $ hg log -Tstatus -r 'wdir()' -C | |||
|
518 | changeset: 2147483647:ffffffffffff | |||
|
519 | parent: 0:8c55c58b4c0e | |||
|
520 | user: test | |||
|
521 | date: * (glob) | |||
|
522 | files: | |||
|
523 | M a | |||
|
524 | b | |||
|
525 | R b | |||
|
526 | ||||
|
527 | ||||
516 | Other "bug" highlight, the revision status does not report the copy information. |
|
528 | Other "bug" highlight, the revision status does not report the copy information. | |
517 | This is buggy behavior. |
|
529 | This is buggy behavior. | |
518 |
|
530 | |||
519 | $ hg commit -m 'blah' |
|
531 | $ hg commit -m 'blah' | |
520 |
$ |
|
532 | $ hg st --copies --change . | |
521 | M a |
|
533 | M a | |
522 | R b |
|
534 | R b | |
523 |
|
535 | |||
|
536 | using log status template, the copy information is displayed correctly. | |||
|
537 | $ hg log -Tstatus -r. -C | |||
|
538 | changeset: 1:6685fde43d21 | |||
|
539 | tag: tip | |||
|
540 | user: test | |||
|
541 | date: * (glob) | |||
|
542 | summary: blah | |||
|
543 | files: | |||
|
544 | M a | |||
|
545 | b | |||
|
546 | R b | |||
|
547 | ||||
|
548 | ||||
524 | $ cd .. |
|
549 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now