Mercurial > hg
comparison tests/test-annotate.t @ 31992:3e47a40d7a7a
context: possibly yield initial fctx in blockdescendants()
If initial 'fctx' has changes in line range with respect to its parents, we
yield it first. This makes 'followlines(..., descend=True)' consistent with
'descendants()' revset which yields the starting revision.
We reuse one iteration of blockancestors() which does exactly what we want.
In test-annotate.t, adjust 'startrev' in one case to cover the situation where
the starting revision does not touch specified line range.
author | Denis Laxalde <denis.laxalde@logilab.fr> |
---|---|
date | Fri, 14 Apr 2017 14:25:06 +0200 |
parents | 55987fc8aba1 |
children | 83527d9f1f13 |
comparison
equal
deleted
inserted
replaced
31991:55987fc8aba1 | 31992:3e47a40d7a7a |
---|---|
498 20: baz:4 | 498 20: baz:4 |
499 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=19)' | 499 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=19)' |
500 16: baz:0 | 500 16: baz:0 |
501 19: baz:3 | 501 19: baz:3 |
502 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=19, descend=True)' | 502 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=19, descend=True)' |
503 19: baz:3 | |
503 20: baz:4 | 504 20: baz:4 |
504 $ printf "0\n0\n" | cat - baz > baz1 | 505 $ printf "0\n0\n" | cat - baz > baz1 |
505 $ mv baz1 baz | 506 $ mv baz1 baz |
506 $ hg ci -m 'added two lines with 0' | 507 $ hg ci -m 'added two lines with 0' |
507 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7)' | 508 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7)' |
508 16: baz:0 | 509 16: baz:0 |
509 19: baz:3 | 510 19: baz:3 |
510 20: baz:4 | 511 20: baz:4 |
511 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, descend=True, startrev=19)' | 512 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, descend=True, startrev=19)' |
513 19: baz:3 | |
512 20: baz:4 | 514 20: baz:4 |
513 $ echo 6 >> baz | 515 $ echo 6 >> baz |
514 $ hg ci -m 'added line 8' | 516 $ hg ci -m 'added line 8' |
515 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7)' | 517 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7)' |
516 16: baz:0 | 518 16: baz:0 |
517 19: baz:3 | 519 19: baz:3 |
518 20: baz:4 | 520 20: baz:4 |
519 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=19, descend=True)' | 521 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=19, descend=True)' |
522 19: baz:3 | |
520 20: baz:4 | 523 20: baz:4 |
521 $ sed 's/3/3+/' baz > baz.new | 524 $ sed 's/3/3+/' baz > baz.new |
522 $ mv baz.new baz | 525 $ mv baz.new baz |
523 $ hg ci -m 'baz:3->3+' | 526 $ hg ci -m 'baz:3->3+' |
524 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7)' | 527 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 5:7)' |
525 16: baz:0 | 528 16: baz:0 |
526 19: baz:3 | 529 19: baz:3 |
527 20: baz:4 | 530 20: baz:4 |
528 23: baz:3->3+ | 531 23: baz:3->3+ |
529 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=19, descend=True)' | 532 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 3:5, startrev=17, descend=True)' |
533 19: baz:3 | |
530 20: baz:4 | 534 20: baz:4 |
531 23: baz:3->3+ | 535 23: baz:3->3+ |
532 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 1:2)' | 536 $ hg log -T '{rev}: {desc}\n' -r 'followlines(baz, 1:2)' |
533 21: added two lines with 0 | 537 21: added two lines with 0 |
534 | 538 |
615 :/ | 619 :/ |
616 o 20: baz:4 | 620 o 20: baz:4 |
617 |\ | 621 |\ |
618 | o 19: baz:3 | 622 | o 19: baz:3 |
619 |/ | 623 |/ |
620 o 18: baz:2 | 624 o 18: baz:2 |
621 |\ | 625 : |
622 ~ ~ | 626 o 16: baz:0 |
627 | | |
628 ~ | |
623 | 629 |
624 check error cases | 630 check error cases |
625 $ hg up 23 --quiet | 631 $ hg up 23 --quiet |
626 $ hg log -r 'followlines()' | 632 $ hg log -r 'followlines()' |
627 hg: parse error: followlines takes at least 1 positional arguments | 633 hg: parse error: followlines takes at least 1 positional arguments |