##// END OF EJS Templates
test-fileset: make con.xml in output conditionally available
Yuya Nishihara -
r38772:0c5d131f stable
parent child Browse files
Show More
@@ -1,676 +1,676 b''
1 $ fileset() {
1 $ fileset() {
2 > hg debugfileset --all-files "$@"
2 > hg debugfileset --all-files "$@"
3 > }
3 > }
4
4
5 $ hg init repo
5 $ hg init repo
6 $ cd repo
6 $ cd repo
7 $ echo a > a1
7 $ echo a > a1
8 $ echo a > a2
8 $ echo a > a2
9 $ echo b > b1
9 $ echo b > b1
10 $ echo b > b2
10 $ echo b > b2
11 $ hg ci -Am addfiles
11 $ hg ci -Am addfiles
12 adding a1
12 adding a1
13 adding a2
13 adding a2
14 adding b1
14 adding b1
15 adding b2
15 adding b2
16
16
17 Test operators and basic patterns
17 Test operators and basic patterns
18
18
19 $ fileset -v a1
19 $ fileset -v a1
20 (symbol 'a1')
20 (symbol 'a1')
21 a1
21 a1
22 $ fileset -v 'a*'
22 $ fileset -v 'a*'
23 (symbol 'a*')
23 (symbol 'a*')
24 a1
24 a1
25 a2
25 a2
26 $ fileset -v '"re:a\d"'
26 $ fileset -v '"re:a\d"'
27 (string 're:a\\d')
27 (string 're:a\\d')
28 a1
28 a1
29 a2
29 a2
30 $ fileset -v '!re:"a\d"'
30 $ fileset -v '!re:"a\d"'
31 (not
31 (not
32 (kindpat
32 (kindpat
33 (symbol 're')
33 (symbol 're')
34 (string 'a\\d')))
34 (string 'a\\d')))
35 b1
35 b1
36 b2
36 b2
37 $ fileset -v 'path:a1 or glob:b?'
37 $ fileset -v 'path:a1 or glob:b?'
38 (or
38 (or
39 (kindpat
39 (kindpat
40 (symbol 'path')
40 (symbol 'path')
41 (symbol 'a1'))
41 (symbol 'a1'))
42 (kindpat
42 (kindpat
43 (symbol 'glob')
43 (symbol 'glob')
44 (symbol 'b?')))
44 (symbol 'b?')))
45 a1
45 a1
46 b1
46 b1
47 b2
47 b2
48 $ fileset -v 'a1 or a2'
48 $ fileset -v 'a1 or a2'
49 (or
49 (or
50 (symbol 'a1')
50 (symbol 'a1')
51 (symbol 'a2'))
51 (symbol 'a2'))
52 a1
52 a1
53 a2
53 a2
54 $ fileset 'a1 | a2'
54 $ fileset 'a1 | a2'
55 a1
55 a1
56 a2
56 a2
57 $ fileset 'a* and "*1"'
57 $ fileset 'a* and "*1"'
58 a1
58 a1
59 $ fileset 'a* & "*1"'
59 $ fileset 'a* & "*1"'
60 a1
60 a1
61 $ fileset 'not (r"a*")'
61 $ fileset 'not (r"a*")'
62 b1
62 b1
63 b2
63 b2
64 $ fileset '! ("a*")'
64 $ fileset '! ("a*")'
65 b1
65 b1
66 b2
66 b2
67 $ fileset 'a* - a1'
67 $ fileset 'a* - a1'
68 a2
68 a2
69 $ fileset 'a_b'
69 $ fileset 'a_b'
70 $ fileset '"\xy"'
70 $ fileset '"\xy"'
71 hg: parse error: invalid \x escape* (glob)
71 hg: parse error: invalid \x escape* (glob)
72 [255]
72 [255]
73
73
74 Test invalid syntax
74 Test invalid syntax
75
75
76 $ fileset -v '"added"()'
76 $ fileset -v '"added"()'
77 (func
77 (func
78 (string 'added')
78 (string 'added')
79 None)
79 None)
80 hg: parse error: not a symbol
80 hg: parse error: not a symbol
81 [255]
81 [255]
82 $ fileset -v '()()'
82 $ fileset -v '()()'
83 (func
83 (func
84 (group
84 (group
85 None)
85 None)
86 None)
86 None)
87 hg: parse error: not a symbol
87 hg: parse error: not a symbol
88 [255]
88 [255]
89 $ fileset -v -- '-x'
89 $ fileset -v -- '-x'
90 (negate
90 (negate
91 (symbol 'x'))
91 (symbol 'x'))
92 hg: parse error: can't use negate operator in this context
92 hg: parse error: can't use negate operator in this context
93 [255]
93 [255]
94 $ fileset -v -- '-()'
94 $ fileset -v -- '-()'
95 (negate
95 (negate
96 (group
96 (group
97 None))
97 None))
98 hg: parse error: can't use negate operator in this context
98 hg: parse error: can't use negate operator in this context
99 [255]
99 [255]
100
100
101 $ fileset '"path":.'
101 $ fileset '"path":.'
102 hg: parse error: not a symbol
102 hg: parse error: not a symbol
103 [255]
103 [255]
104 $ fileset 'path:foo bar'
104 $ fileset 'path:foo bar'
105 hg: parse error at 9: invalid token
105 hg: parse error at 9: invalid token
106 [255]
106 [255]
107 $ fileset 'foo:bar:baz'
107 $ fileset 'foo:bar:baz'
108 hg: parse error: not a symbol
108 hg: parse error: not a symbol
109 [255]
109 [255]
110 $ fileset 'foo:bar()'
110 $ fileset 'foo:bar()'
111 hg: parse error: pattern must be a string
111 hg: parse error: pattern must be a string
112 [255]
112 [255]
113 $ fileset 'foo:bar'
113 $ fileset 'foo:bar'
114 hg: parse error: invalid pattern kind: foo
114 hg: parse error: invalid pattern kind: foo
115 [255]
115 [255]
116
116
117 Test files status
117 Test files status
118
118
119 $ rm a1
119 $ rm a1
120 $ hg rm a2
120 $ hg rm a2
121 $ echo b >> b2
121 $ echo b >> b2
122 $ hg cp b1 c1
122 $ hg cp b1 c1
123 $ echo c > c2
123 $ echo c > c2
124 $ echo c > c3
124 $ echo c > c3
125 $ cat > .hgignore <<EOF
125 $ cat > .hgignore <<EOF
126 > \.hgignore
126 > \.hgignore
127 > 2$
127 > 2$
128 > EOF
128 > EOF
129 $ fileset 'modified()'
129 $ fileset 'modified()'
130 b2
130 b2
131 $ fileset 'added()'
131 $ fileset 'added()'
132 c1
132 c1
133 $ fileset 'removed()'
133 $ fileset 'removed()'
134 a2
134 a2
135 $ fileset 'deleted()'
135 $ fileset 'deleted()'
136 a1
136 a1
137 $ fileset 'missing()'
137 $ fileset 'missing()'
138 a1
138 a1
139 $ fileset 'unknown()'
139 $ fileset 'unknown()'
140 c3
140 c3
141 $ fileset 'ignored()'
141 $ fileset 'ignored()'
142 .hgignore
142 .hgignore
143 c2
143 c2
144 $ fileset 'hgignore()'
144 $ fileset 'hgignore()'
145 .hgignore
145 .hgignore
146 a2
146 a2
147 b2
147 b2
148 c2
148 c2
149 $ fileset 'clean()'
149 $ fileset 'clean()'
150 b1
150 b1
151 $ fileset 'copied()'
151 $ fileset 'copied()'
152 c1
152 c1
153
153
154 Test files status in different revisions
154 Test files status in different revisions
155
155
156 $ hg status -m
156 $ hg status -m
157 M b2
157 M b2
158 $ fileset -r0 'revs("wdir()", modified())' --traceback
158 $ fileset -r0 'revs("wdir()", modified())' --traceback
159 b2
159 b2
160 $ hg status -a
160 $ hg status -a
161 A c1
161 A c1
162 $ fileset -r0 'revs("wdir()", added())'
162 $ fileset -r0 'revs("wdir()", added())'
163 c1
163 c1
164 $ hg status --change 0 -a
164 $ hg status --change 0 -a
165 A a1
165 A a1
166 A a2
166 A a2
167 A b1
167 A b1
168 A b2
168 A b2
169 $ hg status -mru
169 $ hg status -mru
170 M b2
170 M b2
171 R a2
171 R a2
172 ? c3
172 ? c3
173 $ fileset -r0 'added() and revs("wdir()", modified() or removed() or unknown())'
173 $ fileset -r0 'added() and revs("wdir()", modified() or removed() or unknown())'
174 a2
174 a2
175 b2
175 b2
176 $ fileset -r0 'added() or revs("wdir()", added())'
176 $ fileset -r0 'added() or revs("wdir()", added())'
177 a1
177 a1
178 a2
178 a2
179 b1
179 b1
180 b2
180 b2
181 c1
181 c1
182
182
183 Test files properties
183 Test files properties
184
184
185 >>> open('bin', 'wb').write(b'\0a') and None
185 >>> open('bin', 'wb').write(b'\0a') and None
186 $ fileset 'binary()'
186 $ fileset 'binary()'
187 bin
187 bin
188 $ fileset 'binary() and unknown()'
188 $ fileset 'binary() and unknown()'
189 bin
189 bin
190 $ echo '^bin$' >> .hgignore
190 $ echo '^bin$' >> .hgignore
191 $ fileset 'binary() and ignored()'
191 $ fileset 'binary() and ignored()'
192 bin
192 bin
193 $ hg add bin
193 $ hg add bin
194 $ fileset 'binary()'
194 $ fileset 'binary()'
195 bin
195 bin
196
196
197 $ fileset 'grep("b{1}")'
197 $ fileset 'grep("b{1}")'
198 .hgignore
198 .hgignore
199 b1
199 b1
200 b2
200 b2
201 c1
201 c1
202 $ fileset 'grep("missingparens(")'
202 $ fileset 'grep("missingparens(")'
203 hg: parse error: invalid match pattern: (unbalanced parenthesis|missing \)).* (re)
203 hg: parse error: invalid match pattern: (unbalanced parenthesis|missing \)).* (re)
204 [255]
204 [255]
205
205
206 #if execbit
206 #if execbit
207 $ chmod +x b2
207 $ chmod +x b2
208 $ fileset 'exec()'
208 $ fileset 'exec()'
209 b2
209 b2
210 #endif
210 #endif
211
211
212 #if symlink
212 #if symlink
213 $ ln -s b2 b2link
213 $ ln -s b2 b2link
214 $ fileset 'symlink() and unknown()'
214 $ fileset 'symlink() and unknown()'
215 b2link
215 b2link
216 $ hg add b2link
216 $ hg add b2link
217 #endif
217 #endif
218
218
219 #if no-windows
219 #if no-windows
220 $ echo foo > con.xml
220 $ echo foo > con.xml
221 $ fileset 'not portable()'
221 $ fileset 'not portable()'
222 con.xml
222 con.xml
223 $ hg --config ui.portablefilenames=ignore add con.xml
223 $ hg --config ui.portablefilenames=ignore add con.xml
224 #endif
224 #endif
225
225
226 >>> open('1k', 'wb').write(b' '*1024) and None
226 >>> open('1k', 'wb').write(b' '*1024) and None
227 >>> open('2k', 'wb').write(b' '*2048) and None
227 >>> open('2k', 'wb').write(b' '*2048) and None
228 $ hg add 1k 2k
228 $ hg add 1k 2k
229 $ fileset 'size("bar")'
229 $ fileset 'size("bar")'
230 hg: parse error: couldn't parse size: bar
230 hg: parse error: couldn't parse size: bar
231 [255]
231 [255]
232 $ fileset '(1k, 2k)'
232 $ fileset '(1k, 2k)'
233 hg: parse error: can't use a list in this context
233 hg: parse error: can't use a list in this context
234 (see hg help "filesets.x or y")
234 (see hg help "filesets.x or y")
235 [255]
235 [255]
236 $ fileset 'size(1k)'
236 $ fileset 'size(1k)'
237 1k
237 1k
238 $ fileset '(1k or 2k) and size("< 2k")'
238 $ fileset '(1k or 2k) and size("< 2k")'
239 1k
239 1k
240 $ fileset '(1k or 2k) and size("<=2k")'
240 $ fileset '(1k or 2k) and size("<=2k")'
241 1k
241 1k
242 2k
242 2k
243 $ fileset '(1k or 2k) and size("> 1k")'
243 $ fileset '(1k or 2k) and size("> 1k")'
244 2k
244 2k
245 $ fileset '(1k or 2k) and size(">=1K")'
245 $ fileset '(1k or 2k) and size(">=1K")'
246 1k
246 1k
247 2k
247 2k
248 $ fileset '(1k or 2k) and size(".5KB - 1.5kB")'
248 $ fileset '(1k or 2k) and size(".5KB - 1.5kB")'
249 1k
249 1k
250 $ fileset 'size("1M")'
250 $ fileset 'size("1M")'
251 $ fileset 'size("1 GB")'
251 $ fileset 'size("1 GB")'
252
252
253 Test merge states
253 Test merge states
254
254
255 $ hg ci -m manychanges
255 $ hg ci -m manychanges
256 $ hg file -r . 'set:copied() & modified()'
256 $ hg file -r . 'set:copied() & modified()'
257 [1]
257 [1]
258 $ hg up -C 0
258 $ hg up -C 0
259 * files updated, 0 files merged, * files removed, 0 files unresolved (glob)
259 * files updated, 0 files merged, * files removed, 0 files unresolved (glob)
260 $ echo c >> b2
260 $ echo c >> b2
261 $ hg ci -m diverging b2
261 $ hg ci -m diverging b2
262 created new head
262 created new head
263 $ fileset 'resolved()'
263 $ fileset 'resolved()'
264 $ fileset 'unresolved()'
264 $ fileset 'unresolved()'
265 $ hg merge
265 $ hg merge
266 merging b2
266 merging b2
267 warning: conflicts while merging b2! (edit, then use 'hg resolve --mark')
267 warning: conflicts while merging b2! (edit, then use 'hg resolve --mark')
268 * files updated, 0 files merged, 1 files removed, 1 files unresolved (glob)
268 * files updated, 0 files merged, 1 files removed, 1 files unresolved (glob)
269 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
269 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
270 [1]
270 [1]
271 $ fileset 'resolved()'
271 $ fileset 'resolved()'
272 $ fileset 'unresolved()'
272 $ fileset 'unresolved()'
273 b2
273 b2
274 $ echo e > b2
274 $ echo e > b2
275 $ hg resolve -m b2
275 $ hg resolve -m b2
276 (no more unresolved files)
276 (no more unresolved files)
277 $ fileset 'resolved()'
277 $ fileset 'resolved()'
278 b2
278 b2
279 $ fileset 'unresolved()'
279 $ fileset 'unresolved()'
280 $ hg ci -m merge
280 $ hg ci -m merge
281
281
282 Test subrepo predicate
282 Test subrepo predicate
283
283
284 $ hg init sub
284 $ hg init sub
285 $ echo a > sub/suba
285 $ echo a > sub/suba
286 $ hg -R sub add sub/suba
286 $ hg -R sub add sub/suba
287 $ hg -R sub ci -m sub
287 $ hg -R sub ci -m sub
288 $ echo 'sub = sub' > .hgsub
288 $ echo 'sub = sub' > .hgsub
289 $ hg init sub2
289 $ hg init sub2
290 $ echo b > sub2/b
290 $ echo b > sub2/b
291 $ hg -R sub2 ci -Am sub2
291 $ hg -R sub2 ci -Am sub2
292 adding b
292 adding b
293 $ echo 'sub2 = sub2' >> .hgsub
293 $ echo 'sub2 = sub2' >> .hgsub
294 $ fileset 'subrepo()'
294 $ fileset 'subrepo()'
295 $ hg add .hgsub
295 $ hg add .hgsub
296 $ fileset 'subrepo()'
296 $ fileset 'subrepo()'
297 sub
297 sub
298 sub2
298 sub2
299 $ fileset 'subrepo("sub")'
299 $ fileset 'subrepo("sub")'
300 sub
300 sub
301 $ fileset 'subrepo("glob:*")'
301 $ fileset 'subrepo("glob:*")'
302 sub
302 sub
303 sub2
303 sub2
304 $ hg ci -m subrepo
304 $ hg ci -m subrepo
305
305
306 Test that .hgsubstate is updated as appropriate during a conversion. The
306 Test that .hgsubstate is updated as appropriate during a conversion. The
307 saverev property is enough to alter the hashes of the subrepo.
307 saverev property is enough to alter the hashes of the subrepo.
308
308
309 $ hg init ../converted
309 $ hg init ../converted
310 $ hg --config extensions.convert= convert --config convert.hg.saverev=True \
310 $ hg --config extensions.convert= convert --config convert.hg.saverev=True \
311 > sub ../converted/sub
311 > sub ../converted/sub
312 initializing destination ../converted/sub repository
312 initializing destination ../converted/sub repository
313 scanning source...
313 scanning source...
314 sorting...
314 sorting...
315 converting...
315 converting...
316 0 sub
316 0 sub
317 $ hg clone -U sub2 ../converted/sub2
317 $ hg clone -U sub2 ../converted/sub2
318 $ hg --config extensions.convert= convert --config convert.hg.saverev=True \
318 $ hg --config extensions.convert= convert --config convert.hg.saverev=True \
319 > . ../converted
319 > . ../converted
320 scanning source...
320 scanning source...
321 sorting...
321 sorting...
322 converting...
322 converting...
323 4 addfiles
323 4 addfiles
324 3 manychanges
324 3 manychanges
325 2 diverging
325 2 diverging
326 1 merge
326 1 merge
327 0 subrepo
327 0 subrepo
328 no ".hgsubstate" updates will be made for "sub2"
328 no ".hgsubstate" updates will be made for "sub2"
329 $ hg up -q -R ../converted -r tip
329 $ hg up -q -R ../converted -r tip
330 $ hg --cwd ../converted cat sub/suba sub2/b -r tip
330 $ hg --cwd ../converted cat sub/suba sub2/b -r tip
331 a
331 a
332 b
332 b
333 $ oldnode=`hg log -r tip -T "{node}\n"`
333 $ oldnode=`hg log -r tip -T "{node}\n"`
334 $ newnode=`hg log -R ../converted -r tip -T "{node}\n"`
334 $ newnode=`hg log -R ../converted -r tip -T "{node}\n"`
335 $ [ "$oldnode" != "$newnode" ] || echo "nothing changed"
335 $ [ "$oldnode" != "$newnode" ] || echo "nothing changed"
336
336
337 Test with a revision
337 Test with a revision
338
338
339 $ hg log -G --template '{rev} {desc}\n'
339 $ hg log -G --template '{rev} {desc}\n'
340 @ 4 subrepo
340 @ 4 subrepo
341 |
341 |
342 o 3 merge
342 o 3 merge
343 |\
343 |\
344 | o 2 diverging
344 | o 2 diverging
345 | |
345 | |
346 o | 1 manychanges
346 o | 1 manychanges
347 |/
347 |/
348 o 0 addfiles
348 o 0 addfiles
349
349
350 $ echo unknown > unknown
350 $ echo unknown > unknown
351 $ fileset -r1 'modified()'
351 $ fileset -r1 'modified()'
352 b2
352 b2
353 $ fileset -r1 'added() and c1'
353 $ fileset -r1 'added() and c1'
354 c1
354 c1
355 $ fileset -r1 'removed()'
355 $ fileset -r1 'removed()'
356 a2
356 a2
357 $ fileset -r1 'deleted()'
357 $ fileset -r1 'deleted()'
358 $ fileset -r1 'unknown()'
358 $ fileset -r1 'unknown()'
359 $ fileset -r1 'ignored()'
359 $ fileset -r1 'ignored()'
360 $ fileset -r1 'hgignore()'
360 $ fileset -r1 'hgignore()'
361 .hgignore
361 .hgignore
362 a2
362 a2
363 b2
363 b2
364 bin
364 bin
365 c2
365 c2
366 sub2
366 sub2
367 $ fileset -r1 'binary()'
367 $ fileset -r1 'binary()'
368 bin
368 bin
369 $ fileset -r1 'size(1k)'
369 $ fileset -r1 'size(1k)'
370 1k
370 1k
371 $ fileset -r3 'resolved()'
371 $ fileset -r3 'resolved()'
372 $ fileset -r3 'unresolved()'
372 $ fileset -r3 'unresolved()'
373
373
374 #if execbit
374 #if execbit
375 $ fileset -r1 'exec()'
375 $ fileset -r1 'exec()'
376 b2
376 b2
377 #endif
377 #endif
378
378
379 #if symlink
379 #if symlink
380 $ fileset -r1 'symlink()'
380 $ fileset -r1 'symlink()'
381 b2link
381 b2link
382 #endif
382 #endif
383
383
384 #if no-windows
384 #if no-windows
385 $ fileset -r1 'not portable()'
385 $ fileset -r1 'not portable()'
386 con.xml
386 con.xml
387 $ hg forget 'con.xml'
387 $ hg forget 'con.xml'
388 #endif
388 #endif
389
389
390 $ fileset -r4 'subrepo("re:su.*")'
390 $ fileset -r4 'subrepo("re:su.*")'
391 sub
391 sub
392 sub2
392 sub2
393 $ fileset -r4 'subrepo(re:su.*)'
393 $ fileset -r4 'subrepo(re:su.*)'
394 sub
394 sub
395 sub2
395 sub2
396 $ fileset -r4 'subrepo("sub")'
396 $ fileset -r4 'subrepo("sub")'
397 sub
397 sub
398 $ fileset -r4 'b2 or c1'
398 $ fileset -r4 'b2 or c1'
399 b2
399 b2
400 c1
400 c1
401
401
402 >>> open('dos', 'wb').write(b"dos\r\n") and None
402 >>> open('dos', 'wb').write(b"dos\r\n") and None
403 >>> open('mixed', 'wb').write(b"dos\r\nunix\n") and None
403 >>> open('mixed', 'wb').write(b"dos\r\nunix\n") and None
404 >>> open('mac', 'wb').write(b"mac\r") and None
404 >>> open('mac', 'wb').write(b"mac\r") and None
405 $ hg add dos mixed mac
405 $ hg add dos mixed mac
406
406
407 (remove a1, to examine safety of 'eol' on removed files)
407 (remove a1, to examine safety of 'eol' on removed files)
408 $ rm a1
408 $ rm a1
409
409
410 $ fileset 'eol(dos)'
410 $ fileset 'eol(dos)'
411 dos
411 dos
412 mixed
412 mixed
413 $ fileset 'eol(unix)'
413 $ fileset 'eol(unix)'
414 .hgignore
414 .hgignore
415 .hgsub
415 .hgsub
416 .hgsubstate
416 .hgsubstate
417 b1
417 b1
418 b2
418 b2
419 b2.orig
419 b2.orig
420 c1
420 c1
421 c2
421 c2
422 c3
422 c3
423 con.xml
423 con.xml (no-windows !)
424 mixed
424 mixed
425 unknown
425 unknown
426 $ fileset 'eol(mac)'
426 $ fileset 'eol(mac)'
427 mac
427 mac
428
428
429 Test safety of 'encoding' on removed files
429 Test safety of 'encoding' on removed files
430
430
431 $ fileset 'encoding("ascii")'
431 $ fileset 'encoding("ascii")'
432 .hgignore
432 .hgignore
433 .hgsub
433 .hgsub
434 .hgsubstate
434 .hgsubstate
435 1k
435 1k
436 2k
436 2k
437 b1
437 b1
438 b2
438 b2
439 b2.orig
439 b2.orig
440 b2link (symlink !)
440 b2link (symlink !)
441 bin
441 bin
442 c1
442 c1
443 c2
443 c2
444 c3
444 c3
445 con.xml
445 con.xml (no-windows !)
446 dos
446 dos
447 mac
447 mac
448 mixed
448 mixed
449 unknown
449 unknown
450
450
451 Test 'revs(...)'
451 Test 'revs(...)'
452 ================
452 ================
453
453
454 small reminder of the repository state
454 small reminder of the repository state
455
455
456 $ hg log -G
456 $ hg log -G
457 @ changeset: 4:* (glob)
457 @ changeset: 4:* (glob)
458 | tag: tip
458 | tag: tip
459 | user: test
459 | user: test
460 | date: Thu Jan 01 00:00:00 1970 +0000
460 | date: Thu Jan 01 00:00:00 1970 +0000
461 | summary: subrepo
461 | summary: subrepo
462 |
462 |
463 o changeset: 3:* (glob)
463 o changeset: 3:* (glob)
464 |\ parent: 2:55b05bdebf36
464 |\ parent: 2:55b05bdebf36
465 | | parent: 1:* (glob)
465 | | parent: 1:* (glob)
466 | | user: test
466 | | user: test
467 | | date: Thu Jan 01 00:00:00 1970 +0000
467 | | date: Thu Jan 01 00:00:00 1970 +0000
468 | | summary: merge
468 | | summary: merge
469 | |
469 | |
470 | o changeset: 2:55b05bdebf36
470 | o changeset: 2:55b05bdebf36
471 | | parent: 0:8a9576c51c1f
471 | | parent: 0:8a9576c51c1f
472 | | user: test
472 | | user: test
473 | | date: Thu Jan 01 00:00:00 1970 +0000
473 | | date: Thu Jan 01 00:00:00 1970 +0000
474 | | summary: diverging
474 | | summary: diverging
475 | |
475 | |
476 o | changeset: 1:* (glob)
476 o | changeset: 1:* (glob)
477 |/ user: test
477 |/ user: test
478 | date: Thu Jan 01 00:00:00 1970 +0000
478 | date: Thu Jan 01 00:00:00 1970 +0000
479 | summary: manychanges
479 | summary: manychanges
480 |
480 |
481 o changeset: 0:8a9576c51c1f
481 o changeset: 0:8a9576c51c1f
482 user: test
482 user: test
483 date: Thu Jan 01 00:00:00 1970 +0000
483 date: Thu Jan 01 00:00:00 1970 +0000
484 summary: addfiles
484 summary: addfiles
485
485
486 $ hg status --change 0
486 $ hg status --change 0
487 A a1
487 A a1
488 A a2
488 A a2
489 A b1
489 A b1
490 A b2
490 A b2
491 $ hg status --change 1
491 $ hg status --change 1
492 M b2
492 M b2
493 A 1k
493 A 1k
494 A 2k
494 A 2k
495 A b2link (no-windows !)
495 A b2link (no-windows !)
496 A bin
496 A bin
497 A c1
497 A c1
498 A con.xml (no-windows !)
498 A con.xml (no-windows !)
499 R a2
499 R a2
500 $ hg status --change 2
500 $ hg status --change 2
501 M b2
501 M b2
502 $ hg status --change 3
502 $ hg status --change 3
503 M b2
503 M b2
504 A 1k
504 A 1k
505 A 2k
505 A 2k
506 A b2link (no-windows !)
506 A b2link (no-windows !)
507 A bin
507 A bin
508 A c1
508 A c1
509 A con.xml (no-windows !)
509 A con.xml (no-windows !)
510 R a2
510 R a2
511 $ hg status --change 4
511 $ hg status --change 4
512 A .hgsub
512 A .hgsub
513 A .hgsubstate
513 A .hgsubstate
514 $ hg status
514 $ hg status
515 A dos
515 A dos
516 A mac
516 A mac
517 A mixed
517 A mixed
518 R con.xml (no-windows !)
518 R con.xml (no-windows !)
519 ! a1
519 ! a1
520 ? b2.orig
520 ? b2.orig
521 ? c3
521 ? c3
522 ? unknown
522 ? unknown
523
523
524 Test files at -r0 should be filtered by files at wdir
524 Test files at -r0 should be filtered by files at wdir
525 -----------------------------------------------------
525 -----------------------------------------------------
526
526
527 $ fileset -r0 'tracked() and revs("wdir()", tracked())'
527 $ fileset -r0 'tracked() and revs("wdir()", tracked())'
528 a1
528 a1
529 b1
529 b1
530 b2
530 b2
531
531
532 Test that "revs()" work at all
532 Test that "revs()" work at all
533 ------------------------------
533 ------------------------------
534
534
535 $ fileset "revs('2', modified())"
535 $ fileset "revs('2', modified())"
536 b2
536 b2
537
537
538 Test that "revs()" work for file missing in the working copy/current context
538 Test that "revs()" work for file missing in the working copy/current context
539 ----------------------------------------------------------------------------
539 ----------------------------------------------------------------------------
540
540
541 (a2 not in working copy)
541 (a2 not in working copy)
542
542
543 $ fileset "revs('0', added())"
543 $ fileset "revs('0', added())"
544 a1
544 a1
545 a2
545 a2
546 b1
546 b1
547 b2
547 b2
548
548
549 (none of the file exist in "0")
549 (none of the file exist in "0")
550
550
551 $ fileset -r 0 "revs('4', added())"
551 $ fileset -r 0 "revs('4', added())"
552 .hgsub
552 .hgsub
553 .hgsubstate
553 .hgsubstate
554
554
555 Call with empty revset
555 Call with empty revset
556 --------------------------
556 --------------------------
557
557
558 $ fileset "revs('2-2', modified())"
558 $ fileset "revs('2-2', modified())"
559
559
560 Call with revset matching multiple revs
560 Call with revset matching multiple revs
561 ---------------------------------------
561 ---------------------------------------
562
562
563 $ fileset "revs('0+4', added())"
563 $ fileset "revs('0+4', added())"
564 .hgsub
564 .hgsub
565 .hgsubstate
565 .hgsubstate
566 a1
566 a1
567 a2
567 a2
568 b1
568 b1
569 b2
569 b2
570
570
571 overlapping set
571 overlapping set
572
572
573 $ fileset "revs('1+2', modified())"
573 $ fileset "revs('1+2', modified())"
574 b2
574 b2
575
575
576 test 'status(...)'
576 test 'status(...)'
577 =================
577 =================
578
578
579 Simple case
579 Simple case
580 -----------
580 -----------
581
581
582 $ fileset "status(3, 4, added())"
582 $ fileset "status(3, 4, added())"
583 .hgsub
583 .hgsub
584 .hgsubstate
584 .hgsubstate
585
585
586 use rev to restrict matched file
586 use rev to restrict matched file
587 -----------------------------------------
587 -----------------------------------------
588
588
589 $ hg status --removed --rev 0 --rev 1
589 $ hg status --removed --rev 0 --rev 1
590 R a2
590 R a2
591 $ fileset "status(0, 1, removed())"
591 $ fileset "status(0, 1, removed())"
592 a2
592 a2
593 $ fileset "tracked() and status(0, 1, removed())"
593 $ fileset "tracked() and status(0, 1, removed())"
594 $ fileset -r 4 "status(0, 1, removed())"
594 $ fileset -r 4 "status(0, 1, removed())"
595 a2
595 a2
596 $ fileset -r 4 "tracked() and status(0, 1, removed())"
596 $ fileset -r 4 "tracked() and status(0, 1, removed())"
597 $ fileset "revs('4', tracked() and status(0, 1, removed()))"
597 $ fileset "revs('4', tracked() and status(0, 1, removed()))"
598 $ fileset "revs('0', tracked() and status(0, 1, removed()))"
598 $ fileset "revs('0', tracked() and status(0, 1, removed()))"
599 a2
599 a2
600
600
601 check wdir()
601 check wdir()
602 ------------
602 ------------
603
603
604 $ hg status --removed --rev 4
604 $ hg status --removed --rev 4
605 R con.xml (no-windows !)
605 R con.xml (no-windows !)
606 $ fileset "status(4, 'wdir()', removed())"
606 $ fileset "status(4, 'wdir()', removed())"
607 con.xml (no-windows !)
607 con.xml (no-windows !)
608
608
609 $ hg status --removed --rev 2
609 $ hg status --removed --rev 2
610 R a2
610 R a2
611 $ fileset "status('2', 'wdir()', removed())"
611 $ fileset "status('2', 'wdir()', removed())"
612 a2
612 a2
613
613
614 test backward status
614 test backward status
615 --------------------
615 --------------------
616
616
617 $ hg status --removed --rev 0 --rev 4
617 $ hg status --removed --rev 0 --rev 4
618 R a2
618 R a2
619 $ hg status --added --rev 4 --rev 0
619 $ hg status --added --rev 4 --rev 0
620 A a2
620 A a2
621 $ fileset "status(4, 0, added())"
621 $ fileset "status(4, 0, added())"
622 a2
622 a2
623
623
624 test cross branch status
624 test cross branch status
625 ------------------------
625 ------------------------
626
626
627 $ hg status --added --rev 1 --rev 2
627 $ hg status --added --rev 1 --rev 2
628 A a2
628 A a2
629 $ fileset "status(1, 2, added())"
629 $ fileset "status(1, 2, added())"
630 a2
630 a2
631
631
632 test with multi revs revset
632 test with multi revs revset
633 ---------------------------
633 ---------------------------
634 $ hg status --added --rev 0:1 --rev 3:4
634 $ hg status --added --rev 0:1 --rev 3:4
635 A .hgsub
635 A .hgsub
636 A .hgsubstate
636 A .hgsubstate
637 A 1k
637 A 1k
638 A 2k
638 A 2k
639 A b2link (no-windows !)
639 A b2link (no-windows !)
640 A bin
640 A bin
641 A c1
641 A c1
642 A con.xml (no-windows !)
642 A con.xml (no-windows !)
643 $ fileset "status('0:1', '3:4', added())"
643 $ fileset "status('0:1', '3:4', added())"
644 .hgsub
644 .hgsub
645 .hgsubstate
645 .hgsubstate
646 1k
646 1k
647 2k
647 2k
648 b2link (no-windows !)
648 b2link (no-windows !)
649 bin
649 bin
650 c1
650 c1
651 con.xml (no-windows !)
651 con.xml (no-windows !)
652
652
653 tests with empty value
653 tests with empty value
654 ----------------------
654 ----------------------
655
655
656 Fully empty revset
656 Fully empty revset
657
657
658 $ fileset "status('', '4', added())"
658 $ fileset "status('', '4', added())"
659 hg: parse error: first argument to status must be a revision
659 hg: parse error: first argument to status must be a revision
660 [255]
660 [255]
661 $ fileset "status('2', '', added())"
661 $ fileset "status('2', '', added())"
662 hg: parse error: second argument to status must be a revision
662 hg: parse error: second argument to status must be a revision
663 [255]
663 [255]
664
664
665 Empty revset will error at the revset layer
665 Empty revset will error at the revset layer
666
666
667 $ fileset "status(' ', '4', added())"
667 $ fileset "status(' ', '4', added())"
668 hg: parse error at 1: not a prefix: end
668 hg: parse error at 1: not a prefix: end
669 (
669 (
670 ^ here)
670 ^ here)
671 [255]
671 [255]
672 $ fileset "status('2', ' ', added())"
672 $ fileset "status('2', ' ', added())"
673 hg: parse error at 1: not a prefix: end
673 hg: parse error at 1: not a prefix: end
674 (
674 (
675 ^ here)
675 ^ here)
676 [255]
676 [255]
General Comments 0
You need to be logged in to leave comments. Login now