##// END OF EJS Templates
tests: fix a few `(no-windows !)` conditionals that are really `(symlink !)`...
Matt Harbison -
r43743:0a0bad6d default
parent child Browse files
Show More
@@ -1,1037 +1,1037 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 * matcher:
22 22 <patternmatcher patterns='a1$'>
23 23 a1
24 24 $ fileset -v 'a*'
25 25 (symbol 'a*')
26 26 * matcher:
27 27 <patternmatcher patterns='a[^/]*$'>
28 28 a1
29 29 a2
30 30 $ fileset -v '"re:a\d"'
31 31 (string 're:a\\d')
32 32 * matcher:
33 33 <patternmatcher patterns='a\\d'>
34 34 a1
35 35 a2
36 36 $ fileset -v '!re:"a\d"'
37 37 (not
38 38 (kindpat
39 39 (symbol 're')
40 40 (string 'a\\d')))
41 41 * matcher:
42 42 <predicatenmatcher
43 43 pred=<not
44 44 <patternmatcher patterns='a\\d'>>>
45 45 b1
46 46 b2
47 47 $ fileset -v 'path:a1 or glob:b?'
48 48 (or
49 49 (kindpat
50 50 (symbol 'path')
51 51 (symbol 'a1'))
52 52 (kindpat
53 53 (symbol 'glob')
54 54 (symbol 'b?')))
55 55 * matcher:
56 56 <patternmatcher patterns='a1(?:/|$)|b.$'>
57 57 a1
58 58 b1
59 59 b2
60 60 $ fileset -v --no-show-matcher 'a1 or a2'
61 61 (or
62 62 (symbol 'a1')
63 63 (symbol 'a2'))
64 64 a1
65 65 a2
66 66 $ fileset 'a1 | a2'
67 67 a1
68 68 a2
69 69 $ fileset 'a* and "*1"'
70 70 a1
71 71 $ fileset 'a* & "*1"'
72 72 a1
73 73 $ fileset 'not (r"a*")'
74 74 b1
75 75 b2
76 76 $ fileset '! ("a*")'
77 77 b1
78 78 b2
79 79 $ fileset 'a* - a1'
80 80 a2
81 81 $ fileset 'a_b'
82 82 $ fileset '"\xy"'
83 83 hg: parse error: invalid \x escape* (glob)
84 84 [255]
85 85
86 86 Test invalid syntax
87 87
88 88 $ fileset -v '"added"()'
89 89 (func
90 90 (string 'added')
91 91 None)
92 92 hg: parse error: not a symbol
93 93 [255]
94 94 $ fileset -v '()()'
95 95 (func
96 96 (group
97 97 None)
98 98 None)
99 99 hg: parse error: not a symbol
100 100 [255]
101 101 $ fileset -v -- '-x'
102 102 (negate
103 103 (symbol 'x'))
104 104 hg: parse error: can't use negate operator in this context
105 105 [255]
106 106 $ fileset -v -- '-()'
107 107 (negate
108 108 (group
109 109 None))
110 110 hg: parse error: can't use negate operator in this context
111 111 [255]
112 112 $ fileset -p parsed 'a, b, c'
113 113 * parsed:
114 114 (list
115 115 (symbol 'a')
116 116 (symbol 'b')
117 117 (symbol 'c'))
118 118 hg: parse error: can't use a list in this context
119 119 (see 'hg help "filesets.x or y"')
120 120 [255]
121 121
122 122 $ fileset '"path":.'
123 123 hg: parse error: not a symbol
124 124 [255]
125 125 $ fileset 'path:foo bar'
126 126 hg: parse error at 9: invalid token
127 127 [255]
128 128 $ fileset 'foo:bar:baz'
129 129 hg: parse error: not a symbol
130 130 [255]
131 131 $ fileset 'foo:bar()'
132 132 hg: parse error: pattern must be a string
133 133 [255]
134 134 $ fileset 'foo:bar'
135 135 hg: parse error: invalid pattern kind: foo
136 136 [255]
137 137
138 138 Show parsed tree at stages:
139 139
140 140 $ fileset -p unknown a
141 141 abort: invalid stage name: unknown
142 142 [255]
143 143
144 144 $ fileset -p parsed 'path:a1 or glob:b?'
145 145 * parsed:
146 146 (or
147 147 (kindpat
148 148 (symbol 'path')
149 149 (symbol 'a1'))
150 150 (kindpat
151 151 (symbol 'glob')
152 152 (symbol 'b?')))
153 153 a1
154 154 b1
155 155 b2
156 156
157 157 $ fileset -p all -s 'a1 or a2 or (grep("b") & clean())'
158 158 * parsed:
159 159 (or
160 160 (symbol 'a1')
161 161 (symbol 'a2')
162 162 (group
163 163 (and
164 164 (func
165 165 (symbol 'grep')
166 166 (string 'b'))
167 167 (func
168 168 (symbol 'clean')
169 169 None))))
170 170 * analyzed:
171 171 (or
172 172 (symbol 'a1')
173 173 (symbol 'a2')
174 174 (and
175 175 (func
176 176 (symbol 'grep')
177 177 (string 'b'))
178 178 (withstatus
179 179 (func
180 180 (symbol 'clean')
181 181 None)
182 182 (string 'clean'))))
183 183 * optimized:
184 184 (or
185 185 (patterns
186 186 (symbol 'a1')
187 187 (symbol 'a2'))
188 188 (and
189 189 (withstatus
190 190 (func
191 191 (symbol 'clean')
192 192 None)
193 193 (string 'clean'))
194 194 (func
195 195 (symbol 'grep')
196 196 (string 'b'))))
197 197 * matcher:
198 198 <unionmatcher matchers=[
199 199 <patternmatcher patterns='a1$|a2$'>,
200 200 <intersectionmatcher
201 201 m1=<predicatenmatcher pred=clean>,
202 202 m2=<predicatenmatcher pred=grep('b')>>]>
203 203 a1
204 204 a2
205 205 b1
206 206 b2
207 207
208 208 Union of basic patterns:
209 209
210 210 $ fileset -p optimized -s -r. 'a1 or a2 or path:b1'
211 211 * optimized:
212 212 (patterns
213 213 (symbol 'a1')
214 214 (symbol 'a2')
215 215 (kindpat
216 216 (symbol 'path')
217 217 (symbol 'b1')))
218 218 * matcher:
219 219 <patternmatcher patterns='a1$|a2$|b1(?:/|$)'>
220 220 a1
221 221 a2
222 222 b1
223 223
224 224 OR expression should be reordered by weight:
225 225
226 226 $ fileset -p optimized -s -r. 'grep("a") or a1 or grep("b") or b2'
227 227 * optimized:
228 228 (or
229 229 (patterns
230 230 (symbol 'a1')
231 231 (symbol 'b2'))
232 232 (func
233 233 (symbol 'grep')
234 234 (string 'a'))
235 235 (func
236 236 (symbol 'grep')
237 237 (string 'b')))
238 238 * matcher:
239 239 <unionmatcher matchers=[
240 240 <patternmatcher patterns='a1$|b2$'>,
241 241 <predicatenmatcher pred=grep('a')>,
242 242 <predicatenmatcher pred=grep('b')>]>
243 243 a1
244 244 a2
245 245 b1
246 246 b2
247 247
248 248 Use differencematcher for 'x and not y':
249 249
250 250 $ fileset -p optimized -s 'a* and not a1'
251 251 * optimized:
252 252 (minus
253 253 (symbol 'a*')
254 254 (symbol 'a1'))
255 255 * matcher:
256 256 <differencematcher
257 257 m1=<patternmatcher patterns='a[^/]*$'>,
258 258 m2=<patternmatcher patterns='a1$'>>
259 259 a2
260 260
261 261 $ fileset -p optimized -s '!binary() and a*'
262 262 * optimized:
263 263 (minus
264 264 (symbol 'a*')
265 265 (func
266 266 (symbol 'binary')
267 267 None))
268 268 * matcher:
269 269 <differencematcher
270 270 m1=<patternmatcher patterns='a[^/]*$'>,
271 271 m2=<predicatenmatcher pred=binary>>
272 272 a1
273 273 a2
274 274
275 275 'x - y' is rewritten to 'x and not y' first so the operands can be reordered:
276 276
277 277 $ fileset -p analyzed -p optimized -s 'a* - a1'
278 278 * analyzed:
279 279 (and
280 280 (symbol 'a*')
281 281 (not
282 282 (symbol 'a1')))
283 283 * optimized:
284 284 (minus
285 285 (symbol 'a*')
286 286 (symbol 'a1'))
287 287 * matcher:
288 288 <differencematcher
289 289 m1=<patternmatcher patterns='a[^/]*$'>,
290 290 m2=<patternmatcher patterns='a1$'>>
291 291 a2
292 292
293 293 $ fileset -p analyzed -p optimized -s 'binary() - a*'
294 294 * analyzed:
295 295 (and
296 296 (func
297 297 (symbol 'binary')
298 298 None)
299 299 (not
300 300 (symbol 'a*')))
301 301 * optimized:
302 302 (and
303 303 (not
304 304 (symbol 'a*'))
305 305 (func
306 306 (symbol 'binary')
307 307 None))
308 308 * matcher:
309 309 <intersectionmatcher
310 310 m1=<predicatenmatcher
311 311 pred=<not
312 312 <patternmatcher patterns='a[^/]*$'>>>,
313 313 m2=<predicatenmatcher pred=binary>>
314 314
315 315 Test files status
316 316
317 317 $ rm a1
318 318 $ hg rm a2
319 319 $ echo b >> b2
320 320 $ hg cp b1 c1
321 321 $ echo c > c2
322 322 $ echo c > c3
323 323 $ cat > .hgignore <<EOF
324 324 > \.hgignore
325 325 > 2$
326 326 > EOF
327 327 $ fileset 'modified()'
328 328 b2
329 329 $ fileset 'added()'
330 330 c1
331 331 $ fileset 'removed()'
332 332 a2
333 333 $ fileset 'deleted()'
334 334 a1
335 335 $ fileset 'missing()'
336 336 a1
337 337 $ fileset 'unknown()'
338 338 c3
339 339 $ fileset 'ignored()'
340 340 .hgignore
341 341 c2
342 342 $ fileset 'hgignore()'
343 343 .hgignore
344 344 a2
345 345 b2
346 346 c2
347 347 $ fileset 'clean()'
348 348 b1
349 349 $ fileset 'copied()'
350 350 c1
351 351
352 352 Test files status in different revisions
353 353
354 354 $ hg status -m
355 355 M b2
356 356 $ fileset -r0 'revs("wdir()", modified())' --traceback
357 357 b2
358 358 $ hg status -a
359 359 A c1
360 360 $ fileset -r0 'revs("wdir()", added())'
361 361 c1
362 362 $ hg status --change 0 -a
363 363 A a1
364 364 A a2
365 365 A b1
366 366 A b2
367 367 $ hg status -mru
368 368 M b2
369 369 R a2
370 370 ? c3
371 371 $ fileset -r0 'added() and revs("wdir()", modified() or removed() or unknown())'
372 372 a2
373 373 b2
374 374 $ fileset -r0 'added() or revs("wdir()", added())'
375 375 a1
376 376 a2
377 377 b1
378 378 b2
379 379 c1
380 380
381 381 Test insertion of status hints
382 382
383 383 $ fileset -p optimized 'added()'
384 384 * optimized:
385 385 (withstatus
386 386 (func
387 387 (symbol 'added')
388 388 None)
389 389 (string 'added'))
390 390 c1
391 391
392 392 $ fileset -p optimized 'a* & removed()'
393 393 * optimized:
394 394 (and
395 395 (symbol 'a*')
396 396 (withstatus
397 397 (func
398 398 (symbol 'removed')
399 399 None)
400 400 (string 'removed')))
401 401 a2
402 402
403 403 $ fileset -p optimized 'a* - removed()'
404 404 * optimized:
405 405 (minus
406 406 (symbol 'a*')
407 407 (withstatus
408 408 (func
409 409 (symbol 'removed')
410 410 None)
411 411 (string 'removed')))
412 412 a1
413 413
414 414 $ fileset -p analyzed -p optimized '(added() + removed()) - a*'
415 415 * analyzed:
416 416 (and
417 417 (withstatus
418 418 (or
419 419 (func
420 420 (symbol 'added')
421 421 None)
422 422 (func
423 423 (symbol 'removed')
424 424 None))
425 425 (string 'added removed'))
426 426 (not
427 427 (symbol 'a*')))
428 428 * optimized:
429 429 (and
430 430 (not
431 431 (symbol 'a*'))
432 432 (withstatus
433 433 (or
434 434 (func
435 435 (symbol 'added')
436 436 None)
437 437 (func
438 438 (symbol 'removed')
439 439 None))
440 440 (string 'added removed')))
441 441 c1
442 442
443 443 $ fileset -p optimized 'a* + b* + added() + unknown()'
444 444 * optimized:
445 445 (withstatus
446 446 (or
447 447 (patterns
448 448 (symbol 'a*')
449 449 (symbol 'b*'))
450 450 (func
451 451 (symbol 'added')
452 452 None)
453 453 (func
454 454 (symbol 'unknown')
455 455 None))
456 456 (string 'added unknown'))
457 457 a1
458 458 a2
459 459 b1
460 460 b2
461 461 c1
462 462 c3
463 463
464 464 $ fileset -p analyzed -p optimized 'removed() & missing() & a*'
465 465 * analyzed:
466 466 (and
467 467 (withstatus
468 468 (and
469 469 (func
470 470 (symbol 'removed')
471 471 None)
472 472 (func
473 473 (symbol 'missing')
474 474 None))
475 475 (string 'removed missing'))
476 476 (symbol 'a*'))
477 477 * optimized:
478 478 (and
479 479 (symbol 'a*')
480 480 (withstatus
481 481 (and
482 482 (func
483 483 (symbol 'removed')
484 484 None)
485 485 (func
486 486 (symbol 'missing')
487 487 None))
488 488 (string 'removed missing')))
489 489
490 490 $ fileset -p optimized 'clean() & revs(0, added())'
491 491 * optimized:
492 492 (and
493 493 (withstatus
494 494 (func
495 495 (symbol 'clean')
496 496 None)
497 497 (string 'clean'))
498 498 (func
499 499 (symbol 'revs')
500 500 (list
501 501 (symbol '0')
502 502 (withstatus
503 503 (func
504 504 (symbol 'added')
505 505 None)
506 506 (string 'added')))))
507 507 b1
508 508
509 509 $ fileset -p optimized 'clean() & status(null, 0, b* & added())'
510 510 * optimized:
511 511 (and
512 512 (withstatus
513 513 (func
514 514 (symbol 'clean')
515 515 None)
516 516 (string 'clean'))
517 517 (func
518 518 (symbol 'status')
519 519 (list
520 520 (symbol 'null')
521 521 (symbol '0')
522 522 (and
523 523 (symbol 'b*')
524 524 (withstatus
525 525 (func
526 526 (symbol 'added')
527 527 None)
528 528 (string 'added'))))))
529 529 b1
530 530
531 531 Test files properties
532 532
533 533 >>> open('bin', 'wb').write(b'\0a') and None
534 534 $ fileset 'binary()'
535 535 bin
536 536 $ fileset 'binary() and unknown()'
537 537 bin
538 538 $ echo '^bin$' >> .hgignore
539 539 $ fileset 'binary() and ignored()'
540 540 bin
541 541 $ hg add bin
542 542 $ fileset 'binary()'
543 543 bin
544 544
545 545 $ fileset -p optimized -s 'binary() and b*'
546 546 * optimized:
547 547 (and
548 548 (symbol 'b*')
549 549 (func
550 550 (symbol 'binary')
551 551 None))
552 552 * matcher:
553 553 <intersectionmatcher
554 554 m1=<patternmatcher patterns='b[^/]*$'>,
555 555 m2=<predicatenmatcher pred=binary>>
556 556 bin
557 557
558 558 $ fileset 'grep("b{1}")'
559 559 .hgignore
560 560 b1
561 561 b2
562 562 c1
563 563 $ fileset 'grep("missingparens(")'
564 564 hg: parse error: invalid match pattern: (unbalanced parenthesis|missing \)).* (re)
565 565 [255]
566 566
567 567 #if execbit
568 568 $ chmod +x b2
569 569 $ fileset 'exec()'
570 570 b2
571 571 #endif
572 572
573 573 #if symlink
574 574 $ ln -s b2 b2link
575 575 $ fileset 'symlink() and unknown()'
576 576 b2link
577 577 $ hg add b2link
578 578 #endif
579 579
580 580 #if no-windows
581 581 $ echo foo > con.xml
582 582 $ fileset 'not portable()'
583 583 con.xml
584 584 $ hg --config ui.portablefilenames=ignore add con.xml
585 585 #endif
586 586
587 587 >>> open('1k', 'wb').write(b' '*1024) and None
588 588 >>> open('2k', 'wb').write(b' '*2048) and None
589 589 $ hg add 1k 2k
590 590 $ fileset 'size("bar")'
591 591 hg: parse error: couldn't parse size: bar
592 592 [255]
593 593 $ fileset '(1k, 2k)'
594 594 hg: parse error: can't use a list in this context
595 595 (see 'hg help "filesets.x or y"')
596 596 [255]
597 597 $ fileset 'size(1k)'
598 598 1k
599 599 $ fileset '(1k or 2k) and size("< 2k")'
600 600 1k
601 601 $ fileset '(1k or 2k) and size("<=2k")'
602 602 1k
603 603 2k
604 604 $ fileset '(1k or 2k) and size("> 1k")'
605 605 2k
606 606 $ fileset '(1k or 2k) and size(">=1K")'
607 607 1k
608 608 2k
609 609 $ fileset '(1k or 2k) and size(".5KB - 1.5kB")'
610 610 1k
611 611 $ fileset 'size("1M")'
612 612 $ fileset 'size("1 GB")'
613 613
614 614 Test merge states
615 615
616 616 $ hg ci -m manychanges
617 617 $ hg file -r . 'set:copied() & modified()'
618 618 [1]
619 619 $ hg up -C 0
620 620 * files updated, 0 files merged, * files removed, 0 files unresolved (glob)
621 621 $ echo c >> b2
622 622 $ hg ci -m diverging b2
623 623 created new head
624 624 $ fileset 'resolved()'
625 625 $ fileset 'unresolved()'
626 626 $ hg merge
627 627 merging b2
628 628 warning: conflicts while merging b2! (edit, then use 'hg resolve --mark')
629 629 * files updated, 0 files merged, 1 files removed, 1 files unresolved (glob)
630 630 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
631 631 [1]
632 632 $ fileset 'resolved()'
633 633 $ fileset 'unresolved()'
634 634 b2
635 635 $ echo e > b2
636 636 $ hg resolve -m b2
637 637 (no more unresolved files)
638 638 $ fileset 'resolved()'
639 639 b2
640 640 $ fileset 'unresolved()'
641 641 $ hg ci -m merge
642 642
643 643 Test subrepo predicate
644 644
645 645 $ hg init sub
646 646 $ echo a > sub/suba
647 647 $ hg -R sub add sub/suba
648 648 $ hg -R sub ci -m sub
649 649 $ echo 'sub = sub' > .hgsub
650 650 $ hg init sub2
651 651 $ echo b > sub2/b
652 652 $ hg -R sub2 ci -Am sub2
653 653 adding b
654 654 $ echo 'sub2 = sub2' >> .hgsub
655 655 $ fileset 'subrepo()'
656 656 $ hg add .hgsub
657 657 $ fileset 'subrepo()'
658 658 sub
659 659 sub2
660 660 $ fileset 'subrepo("sub")'
661 661 sub
662 662 $ fileset 'subrepo("glob:*")'
663 663 sub
664 664 sub2
665 665 $ hg ci -m subrepo
666 666
667 667 Test that .hgsubstate is updated as appropriate during a conversion. The
668 668 saverev property is enough to alter the hashes of the subrepo.
669 669
670 670 $ hg init ../converted
671 671 $ hg --config extensions.convert= convert --config convert.hg.saverev=True \
672 672 > sub ../converted/sub
673 673 initializing destination ../converted/sub repository
674 674 scanning source...
675 675 sorting...
676 676 converting...
677 677 0 sub
678 678 $ hg clone -U sub2 ../converted/sub2
679 679 $ hg --config extensions.convert= convert --config convert.hg.saverev=True \
680 680 > . ../converted
681 681 scanning source...
682 682 sorting...
683 683 converting...
684 684 4 addfiles
685 685 3 manychanges
686 686 2 diverging
687 687 1 merge
688 688 0 subrepo
689 689 no ".hgsubstate" updates will be made for "sub2"
690 690 $ hg up -q -R ../converted -r tip
691 691 $ hg --cwd ../converted cat sub/suba sub2/b -r tip
692 692 a
693 693 b
694 694 $ oldnode=`hg log -r tip -T "{node}\n"`
695 695 $ newnode=`hg log -R ../converted -r tip -T "{node}\n"`
696 696 $ [ "$oldnode" != "$newnode" ] || echo "nothing changed"
697 697
698 698 Test with a revision
699 699
700 700 $ hg log -G --template '{rev} {desc}\n'
701 701 @ 4 subrepo
702 702 |
703 703 o 3 merge
704 704 |\
705 705 | o 2 diverging
706 706 | |
707 707 o | 1 manychanges
708 708 |/
709 709 o 0 addfiles
710 710
711 711 $ echo unknown > unknown
712 712 $ fileset -r1 'modified()'
713 713 b2
714 714 $ fileset -r1 'added() and c1'
715 715 c1
716 716 $ fileset -r1 'removed()'
717 717 a2
718 718 $ fileset -r1 'deleted()'
719 719 $ fileset -r1 'unknown()'
720 720 $ fileset -r1 'ignored()'
721 721 $ fileset -r1 'hgignore()'
722 722 .hgignore
723 723 a2
724 724 b2
725 725 bin
726 726 c2
727 727 sub2
728 728 $ fileset -r1 'binary()'
729 729 bin
730 730 $ fileset -r1 'size(1k)'
731 731 1k
732 732 $ fileset -r3 'resolved()'
733 733 $ fileset -r3 'unresolved()'
734 734
735 735 #if execbit
736 736 $ fileset -r1 'exec()'
737 737 b2
738 738 #endif
739 739
740 740 #if symlink
741 741 $ fileset -r1 'symlink()'
742 742 b2link
743 743 #endif
744 744
745 745 #if no-windows
746 746 $ fileset -r1 'not portable()'
747 747 con.xml
748 748 $ hg forget 'con.xml'
749 749 #endif
750 750
751 751 $ fileset -r4 'subrepo("re:su.*")'
752 752 sub
753 753 sub2
754 754 $ fileset -r4 'subrepo(re:su.*)'
755 755 sub
756 756 sub2
757 757 $ fileset -r4 'subrepo("sub")'
758 758 sub
759 759 $ fileset -r4 'b2 or c1'
760 760 b2
761 761 c1
762 762
763 763 >>> open('dos', 'wb').write(b"dos\r\n") and None
764 764 >>> open('mixed', 'wb').write(b"dos\r\nunix\n") and None
765 765 >>> open('mac', 'wb').write(b"mac\r") and None
766 766 $ hg add dos mixed mac
767 767
768 768 (remove a1, to examine safety of 'eol' on removed files)
769 769 $ rm a1
770 770
771 771 $ fileset 'eol(dos)'
772 772 dos
773 773 mixed
774 774 $ fileset 'eol(unix)'
775 775 .hgignore
776 776 .hgsub
777 777 .hgsubstate
778 778 b1
779 779 b2
780 780 b2.orig
781 781 c1
782 782 c2
783 783 c3
784 784 con.xml (no-windows !)
785 785 mixed
786 786 unknown
787 787 $ fileset 'eol(mac)'
788 788 mac
789 789
790 790 Test safety of 'encoding' on removed files
791 791
792 792 $ fileset 'encoding("ascii")'
793 793 .hgignore
794 794 .hgsub
795 795 .hgsubstate
796 796 1k
797 797 2k
798 798 b1
799 799 b2
800 800 b2.orig
801 801 b2link (symlink !)
802 802 bin
803 803 c1
804 804 c2
805 805 c3
806 806 con.xml (no-windows !)
807 807 dos
808 808 mac
809 809 mixed
810 810 unknown
811 811
812 812 Test 'revs(...)'
813 813 ================
814 814
815 815 small reminder of the repository state
816 816
817 817 $ hg log -G
818 818 @ changeset: 4:* (glob)
819 819 | tag: tip
820 820 | user: test
821 821 | date: Thu Jan 01 00:00:00 1970 +0000
822 822 | summary: subrepo
823 823 |
824 824 o changeset: 3:* (glob)
825 825 |\ parent: 2:55b05bdebf36
826 826 | | parent: 1:* (glob)
827 827 | | user: test
828 828 | | date: Thu Jan 01 00:00:00 1970 +0000
829 829 | | summary: merge
830 830 | |
831 831 | o changeset: 2:55b05bdebf36
832 832 | | parent: 0:8a9576c51c1f
833 833 | | user: test
834 834 | | date: Thu Jan 01 00:00:00 1970 +0000
835 835 | | summary: diverging
836 836 | |
837 837 o | changeset: 1:* (glob)
838 838 |/ user: test
839 839 | date: Thu Jan 01 00:00:00 1970 +0000
840 840 | summary: manychanges
841 841 |
842 842 o changeset: 0:8a9576c51c1f
843 843 user: test
844 844 date: Thu Jan 01 00:00:00 1970 +0000
845 845 summary: addfiles
846 846
847 847 $ hg status --change 0
848 848 A a1
849 849 A a2
850 850 A b1
851 851 A b2
852 852 $ hg status --change 1
853 853 M b2
854 854 A 1k
855 855 A 2k
856 A b2link (no-windows !)
856 A b2link (symlink !)
857 857 A bin
858 858 A c1
859 859 A con.xml (no-windows !)
860 860 R a2
861 861 $ hg status --change 2
862 862 M b2
863 863 $ hg status --change 3
864 864 M b2
865 865 A 1k
866 866 A 2k
867 A b2link (no-windows !)
867 A b2link (symlink !)
868 868 A bin
869 869 A c1
870 870 A con.xml (no-windows !)
871 871 R a2
872 872 $ hg status --change 4
873 873 A .hgsub
874 874 A .hgsubstate
875 875 $ hg status
876 876 A dos
877 877 A mac
878 878 A mixed
879 879 R con.xml (no-windows !)
880 880 ! a1
881 881 ? b2.orig
882 882 ? c3
883 883 ? unknown
884 884
885 885 Test files at -r0 should be filtered by files at wdir
886 886 -----------------------------------------------------
887 887
888 888 $ fileset -r0 'tracked() and revs("wdir()", tracked())'
889 889 a1
890 890 b1
891 891 b2
892 892
893 893 Test that "revs()" work at all
894 894 ------------------------------
895 895
896 896 $ fileset "revs('2', modified())"
897 897 b2
898 898
899 899 Test that "revs()" work for file missing in the working copy/current context
900 900 ----------------------------------------------------------------------------
901 901
902 902 (a2 not in working copy)
903 903
904 904 $ fileset "revs('0', added())"
905 905 a1
906 906 a2
907 907 b1
908 908 b2
909 909
910 910 (none of the file exist in "0")
911 911
912 912 $ fileset -r 0 "revs('4', added())"
913 913 .hgsub
914 914 .hgsubstate
915 915
916 916 Call with empty revset
917 917 --------------------------
918 918
919 919 $ fileset "revs('2-2', modified())"
920 920
921 921 Call with revset matching multiple revs
922 922 ---------------------------------------
923 923
924 924 $ fileset "revs('0+4', added())"
925 925 .hgsub
926 926 .hgsubstate
927 927 a1
928 928 a2
929 929 b1
930 930 b2
931 931
932 932 overlapping set
933 933
934 934 $ fileset "revs('1+2', modified())"
935 935 b2
936 936
937 937 test 'status(...)'
938 938 =================
939 939
940 940 Simple case
941 941 -----------
942 942
943 943 $ fileset "status(3, 4, added())"
944 944 .hgsub
945 945 .hgsubstate
946 946
947 947 use rev to restrict matched file
948 948 -----------------------------------------
949 949
950 950 $ hg status --removed --rev 0 --rev 1
951 951 R a2
952 952 $ fileset "status(0, 1, removed())"
953 953 a2
954 954 $ fileset "tracked() and status(0, 1, removed())"
955 955 $ fileset -r 4 "status(0, 1, removed())"
956 956 a2
957 957 $ fileset -r 4 "tracked() and status(0, 1, removed())"
958 958 $ fileset "revs('4', tracked() and status(0, 1, removed()))"
959 959 $ fileset "revs('0', tracked() and status(0, 1, removed()))"
960 960 a2
961 961
962 962 check wdir()
963 963 ------------
964 964
965 965 $ hg status --removed --rev 4
966 966 R con.xml (no-windows !)
967 967 $ fileset "status(4, 'wdir()', removed())"
968 968 con.xml (no-windows !)
969 969
970 970 $ hg status --removed --rev 2
971 971 R a2
972 972 $ fileset "status('2', 'wdir()', removed())"
973 973 a2
974 974
975 975 test backward status
976 976 --------------------
977 977
978 978 $ hg status --removed --rev 0 --rev 4
979 979 R a2
980 980 $ hg status --added --rev 4 --rev 0
981 981 A a2
982 982 $ fileset "status(4, 0, added())"
983 983 a2
984 984
985 985 test cross branch status
986 986 ------------------------
987 987
988 988 $ hg status --added --rev 1 --rev 2
989 989 A a2
990 990 $ fileset "status(1, 2, added())"
991 991 a2
992 992
993 993 test with multi revs revset
994 994 ---------------------------
995 995 $ hg status --added --rev 0:1 --rev 3:4
996 996 A .hgsub
997 997 A .hgsubstate
998 998 A 1k
999 999 A 2k
1000 A b2link (no-windows !)
1000 A b2link (symlink !)
1001 1001 A bin
1002 1002 A c1
1003 1003 A con.xml (no-windows !)
1004 1004 $ fileset "status('0:1', '3:4', added())"
1005 1005 .hgsub
1006 1006 .hgsubstate
1007 1007 1k
1008 1008 2k
1009 b2link (no-windows !)
1009 b2link (symlink !)
1010 1010 bin
1011 1011 c1
1012 1012 con.xml (no-windows !)
1013 1013
1014 1014 tests with empty value
1015 1015 ----------------------
1016 1016
1017 1017 Fully empty revset
1018 1018
1019 1019 $ fileset "status('', '4', added())"
1020 1020 hg: parse error: first argument to status must be a revision
1021 1021 [255]
1022 1022 $ fileset "status('2', '', added())"
1023 1023 hg: parse error: second argument to status must be a revision
1024 1024 [255]
1025 1025
1026 1026 Empty revset will error at the revset layer
1027 1027
1028 1028 $ fileset "status(' ', '4', added())"
1029 1029 hg: parse error at 1: not a prefix: end
1030 1030 (
1031 1031 ^ here)
1032 1032 [255]
1033 1033 $ fileset "status('2', ' ', added())"
1034 1034 hg: parse error at 1: not a prefix: end
1035 1035 (
1036 1036 ^ here)
1037 1037 [255]
General Comments 0
You need to be logged in to leave comments. Login now