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