482 |
482 |
483 $ hg revert --all --no-backup --quiet |
483 $ hg revert --all --no-backup --quiet |
484 $ hg id -n |
484 $ hg id -n |
485 20 |
485 20 |
486 |
486 |
487 Test followlines() revset |
487 Test followlines() revset; we usually check both followlines(pat, range) and |
|
488 followlines(pat, range, descend=True) to make sure both give the same result |
|
489 when they should. |
488 |
490 |
489 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5)' |
491 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5)' |
490 16: baz:0 |
492 16: baz:0 |
491 19: baz:3 |
493 19: baz:3 |
492 20: baz:4 |
494 20: baz:4 |
493 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=20)' |
495 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=20)' |
494 16: baz:0 |
496 16: baz:0 |
495 19: baz:3 |
497 19: baz:3 |
496 20: baz:4 |
498 20: baz:4 |
497 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=.^)' |
499 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=19)' |
498 16: baz:0 |
500 16: baz:0 |
499 19: baz:3 |
501 19: baz:3 |
|
502 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=19, descend=True)' |
|
503 20: baz:4 |
500 $ printf "0\n0\n" | cat - baz > baz1 |
504 $ printf "0\n0\n" | cat - baz > baz1 |
501 $ mv baz1 baz |
505 $ mv baz1 baz |
502 $ hg ci -m 'added two lines with 0' |
506 $ hg ci -m 'added two lines with 0' |
503 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7)' |
507 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7)' |
504 16: baz:0 |
508 16: baz:0 |
505 19: baz:3 |
509 19: baz:3 |
506 20: baz:4 |
510 20: baz:4 |
|
511 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, descend=True, startrev=19)' |
|
512 20: baz:4 |
507 $ echo 6 >> baz |
513 $ echo 6 >> baz |
508 $ hg ci -m 'added line 8' |
514 $ hg ci -m 'added line 8' |
509 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7)' |
515 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7)' |
510 16: baz:0 |
516 16: baz:0 |
511 19: baz:3 |
517 19: baz:3 |
|
518 20: baz:4 |
|
519 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=19, descend=True)' |
512 20: baz:4 |
520 20: baz:4 |
513 $ sed 's/3/3+/' baz > baz.new |
521 $ sed 's/3/3+/' baz > baz.new |
514 $ mv baz.new baz |
522 $ mv baz.new baz |
515 $ hg ci -m 'baz:3->3+' |
523 $ hg ci -m 'baz:3->3+' |
516 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7)' |
524 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7)' |
517 16: baz:0 |
525 16: baz:0 |
518 19: baz:3 |
526 19: baz:3 |
|
527 20: baz:4 |
|
528 23: baz:3->3+ |
|
529 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=19, descend=True)' |
519 20: baz:4 |
530 20: baz:4 |
520 23: baz:3->3+ |
531 23: baz:3->3+ |
521 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 1:2)' |
532 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 1:2)' |
522 21: added two lines with 0 |
533 21: added two lines with 0 |
523 |
534 |