Mercurial > evolve
comparison tests/test-stablesort.t @ 3255:bb3f8c8c1232
stablesort: introduce a mergepoint based method focused on head
The things we needs for stable range is head centric. So we simplify the issue
by focussing on head.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sat, 25 Nov 2017 15:14:50 -0500 |
parents | 00e20077bccf |
children | c82a2632327e |
comparison
equal
deleted
inserted
replaced
3254:00e20077bccf | 3255:bb3f8c8c1232 |
---|---|
8 > hgext3rd.evolve = | 8 > hgext3rd.evolve = |
9 > [ui] | 9 > [ui] |
10 > logtemplate = "{rev} {node|short} {desc} {tags}\n" | 10 > logtemplate = "{rev} {node|short} {desc} {tags}\n" |
11 > [alias] | 11 > [alias] |
12 > showsort = debugstablesort --template="{node|short}\n" --method basic-mergepoint | 12 > showsort = debugstablesort --template="{node|short}\n" --method basic-mergepoint |
13 > showsorthead = debugstablesort --template="{node|short}\n" --method basic-headstart | |
13 > EOF | 14 > EOF |
14 | 15 |
15 | 16 |
16 | 17 |
17 $ checktopo () { | 18 $ checktopo () { |
122 e7d9710d9fc6 | 123 e7d9710d9fc6 |
123 d62d843c9a01 | 124 d62d843c9a01 |
124 dcbb326fdec2 | 125 dcbb326fdec2 |
125 e46a4836065c | 126 e46a4836065c |
126 ff43616e5d0f | 127 ff43616e5d0f |
128 $ hg showsorthead --rev 1d8d22637c2d | |
129 1ea73414a91b | |
130 66f7d451a68b | |
131 fa942426a6fd | |
132 2b6d669947cd | |
133 43227190fef8 | |
134 4c748ffd1a46 | |
135 f0f3ef9a6cd5 | |
136 1d8d22637c2d | |
137 $ hg showsorthead --rev b4594d867745 | |
138 1ea73414a91b | |
139 66f7d451a68b | |
140 fa942426a6fd | |
141 2b6d669947cd | |
142 bab5d5bf48bd | |
143 b4594d867745 | |
144 $ hg showsorthead --rev e46a4836065c | |
145 1ea73414a91b | |
146 66f7d451a68b | |
147 fa942426a6fd | |
148 2b6d669947cd | |
149 bab5d5bf48bd | |
150 e46a4836065c | |
151 $ hg showsorthead --rev ff43616e5d0f | |
152 1ea73414a91b | |
153 66f7d451a68b | |
154 fa942426a6fd | |
155 2b6d669947cd | |
156 e7d9710d9fc6 | |
157 d62d843c9a01 | |
158 ff43616e5d0f | |
159 $ hg showsorthead --rev dcbb326fdec2 | |
160 1ea73414a91b | |
161 66f7d451a68b | |
162 fa942426a6fd | |
163 2b6d669947cd | |
164 e7d9710d9fc6 | |
165 d62d843c9a01 | |
166 dcbb326fdec2 | |
167 $ hg showsorthead --rev 2702dd0c91e7 | |
168 1ea73414a91b | |
169 fa942426a6fd | |
170 4c748ffd1a46 | |
171 f0f3ef9a6cd5 | |
172 2702dd0c91e7 | |
127 | 173 |
128 Verify the topological order | 174 Verify the topological order |
129 ---------------------------- | 175 ---------------------------- |
130 | 176 |
131 Check we we did not issued a node before on ancestor | 177 Check we we did not issued a node before on ancestor |
428 | 474 |
429 one secific heads, that is a merge | 475 one secific heads, that is a merge |
430 | 476 |
431 $ for x in $repos; do | 477 $ for x in $repos; do |
432 > hg -R repo_$x showsort --rev '1d8d22637c2d' > ${x}.1d8d22637c2d.order; | 478 > hg -R repo_$x showsort --rev '1d8d22637c2d' > ${x}.1d8d22637c2d.order; |
479 > hg -R repo_$x showsorthead --rev '1d8d22637c2d' > ${x}.1d8d22637c2d.orderhead; | |
433 > done | 480 > done |
434 | 481 |
435 $ python "$RUNTESTDIR/md5sum.py" *.1d8d22637c2d.order | 482 $ python "$RUNTESTDIR/md5sum.py" *.1d8d22637c2d.order |
436 77dc20a6f86db9103df8edaae9ad2754 A.1d8d22637c2d.order | 483 77dc20a6f86db9103df8edaae9ad2754 A.1d8d22637c2d.order |
437 77dc20a6f86db9103df8edaae9ad2754 B.1d8d22637c2d.order | 484 77dc20a6f86db9103df8edaae9ad2754 B.1d8d22637c2d.order |
438 77dc20a6f86db9103df8edaae9ad2754 C.1d8d22637c2d.order | 485 77dc20a6f86db9103df8edaae9ad2754 C.1d8d22637c2d.order |
439 77dc20a6f86db9103df8edaae9ad2754 D.1d8d22637c2d.order | 486 77dc20a6f86db9103df8edaae9ad2754 D.1d8d22637c2d.order |
487 $ python "$RUNTESTDIR/md5sum.py" *.1d8d22637c2d.orderhead | |
488 77dc20a6f86db9103df8edaae9ad2754 A.1d8d22637c2d.orderhead | |
489 77dc20a6f86db9103df8edaae9ad2754 B.1d8d22637c2d.orderhead | |
490 77dc20a6f86db9103df8edaae9ad2754 C.1d8d22637c2d.orderhead | |
491 77dc20a6f86db9103df8edaae9ad2754 D.1d8d22637c2d.orderhead | |
440 | 492 |
441 changeset that are not heads | 493 changeset that are not heads |
442 | 494 |
443 $ for x in $repos; do | 495 $ for x in $repos; do |
444 > hg -R repo_$x showsort --rev 'e7d9710d9fc6+43227190fef8' > ${x}.non-heads.order; | 496 > hg -R repo_$x showsort --rev 'e7d9710d9fc6+43227190fef8' > ${x}.non-heads.order; |
497 > hg -R repo_$x showsorthead --rev 'e7d9710d9fc6+43227190fef8' > ${x}.non-heads.orderhead; | |
445 > done | 498 > done |
446 | 499 |
447 $ python "$RUNTESTDIR/md5sum.py" *.non-heads.order | 500 $ python "$RUNTESTDIR/md5sum.py" *.non-heads.order |
448 94e0ea8cdade135dabde4ec5e9954329 A.non-heads.order | 501 94e0ea8cdade135dabde4ec5e9954329 A.non-heads.order |
449 94e0ea8cdade135dabde4ec5e9954329 B.non-heads.order | 502 94e0ea8cdade135dabde4ec5e9954329 B.non-heads.order |
450 94e0ea8cdade135dabde4ec5e9954329 C.non-heads.order | 503 94e0ea8cdade135dabde4ec5e9954329 C.non-heads.order |
451 94e0ea8cdade135dabde4ec5e9954329 D.non-heads.order | 504 94e0ea8cdade135dabde4ec5e9954329 D.non-heads.order |
505 $ python "$RUNTESTDIR/md5sum.py" *.non-heads.orderhead | |
506 1e5ce05b507a058c5dac3d7de9ae8feb A.non-heads.orderhead | |
507 1e5ce05b507a058c5dac3d7de9ae8feb B.non-heads.orderhead | |
508 1e5ce05b507a058c5dac3d7de9ae8feb C.non-heads.orderhead | |
509 1e5ce05b507a058c5dac3d7de9ae8feb D.non-heads.orderhead | |
452 | 510 |
453 Check with different subset | 511 Check with different subset |
454 | 512 |
455 $ hg clone repo_A repo_E --rev "43227190fef8" | 513 $ hg clone repo_A repo_E --rev "43227190fef8" |
456 adding changesets | 514 adding changesets |
515 new changesets 4c748ffd1a46:2702dd0c91e7 | 573 new changesets 4c748ffd1a46:2702dd0c91e7 |
516 (run 'hg heads .' to see heads, 'hg merge' to merge) | 574 (run 'hg heads .' to see heads, 'hg merge' to merge) |
517 | 575 |
518 $ for x in E F G; do | 576 $ for x in E F G; do |
519 > hg -R repo_$x showsort --rev 'e7d9710d9fc6+43227190fef8' > ${x}.non-heads.order; | 577 > hg -R repo_$x showsort --rev 'e7d9710d9fc6+43227190fef8' > ${x}.non-heads.order; |
578 > hg -R repo_$x showsort --rev 'e7d9710d9fc6' > ${x}.non-head-A.orderhead; | |
579 > hg -R repo_$x showsort --rev '43227190fef8' > ${x}.non-head-B.orderhead; | |
520 > done | 580 > done |
521 | 581 |
522 $ python "$RUNTESTDIR/md5sum.py" *.non-heads.order | 582 $ python "$RUNTESTDIR/md5sum.py" *.non-heads.order |
523 94e0ea8cdade135dabde4ec5e9954329 A.non-heads.order | 583 94e0ea8cdade135dabde4ec5e9954329 A.non-heads.order |
524 94e0ea8cdade135dabde4ec5e9954329 B.non-heads.order | 584 94e0ea8cdade135dabde4ec5e9954329 B.non-heads.order |
525 94e0ea8cdade135dabde4ec5e9954329 C.non-heads.order | 585 94e0ea8cdade135dabde4ec5e9954329 C.non-heads.order |
526 94e0ea8cdade135dabde4ec5e9954329 D.non-heads.order | 586 94e0ea8cdade135dabde4ec5e9954329 D.non-heads.order |
527 94e0ea8cdade135dabde4ec5e9954329 E.non-heads.order | 587 94e0ea8cdade135dabde4ec5e9954329 E.non-heads.order |
528 94e0ea8cdade135dabde4ec5e9954329 F.non-heads.order | 588 94e0ea8cdade135dabde4ec5e9954329 F.non-heads.order |
529 94e0ea8cdade135dabde4ec5e9954329 G.non-heads.order | 589 94e0ea8cdade135dabde4ec5e9954329 G.non-heads.order |
590 $ python "$RUNTESTDIR/md5sum.py" *.non-head-A.orderhead | |
591 1e5ce05b507a058c5dac3d7de9ae8feb E.non-head-A.orderhead | |
592 1e5ce05b507a058c5dac3d7de9ae8feb F.non-head-A.orderhead | |
593 1e5ce05b507a058c5dac3d7de9ae8feb G.non-head-A.orderhead | |
594 $ python "$RUNTESTDIR/md5sum.py" *.non-head-B.orderhead | |
595 4b07febabfee9528aedcea156a7d7071 E.non-head-B.orderhead | |
596 4b07febabfee9528aedcea156a7d7071 F.non-head-B.orderhead | |
597 4b07febabfee9528aedcea156a7d7071 G.non-head-B.orderhead | |
530 | 598 |
531 Multiple recursions | 599 Multiple recursions |
532 =================== | 600 =================== |
533 | 601 |
534 $ hg init recursion_A | 602 $ hg init recursion_A |
629 1c645e73dbc6 | 697 1c645e73dbc6 |
630 160a7a0adbf4 | 698 160a7a0adbf4 |
631 a66b68853635 | 699 a66b68853635 |
632 013b27f11536 | 700 013b27f11536 |
633 4bbfc6078919 | 701 4bbfc6078919 |
702 $ hg showsorthead --rev '160a7a0adbf4' | |
703 1ea73414a91b | |
704 66f7d451a68b | |
705 01241442b3c2 | |
706 2dc09a01254d | |
707 abf57d94268b | |
708 529dfc5bb875 | |
709 e7bd5218ca15 | |
710 6ee532b68cfa | |
711 001194dd78d5 | |
712 3a367db1fabc | |
713 a2f58e9c1e56 | |
714 5f18015f9110 | |
715 9fff0871d230 | |
716 4dbf739dd63f | |
717 d64d500024d1 | |
718 0496f0a6a143 | |
719 1c645e73dbc6 | |
720 160a7a0adbf4 | |
721 $ hg showsorthead --rev '4bbfc6078919' | |
722 1ea73414a91b | |
723 66f7d451a68b | |
724 01241442b3c2 | |
725 2dc09a01254d | |
726 abf57d94268b | |
727 529dfc5bb875 | |
728 e7bd5218ca15 | |
729 6ee532b68cfa | |
730 001194dd78d5 | |
731 a66b68853635 | |
732 013b27f11536 | |
733 4bbfc6078919 | |
634 $ checktopo 'all()' | 734 $ checktopo 'all()' |
635 === checking 1ea73414a91b === | 735 === checking 1ea73414a91b === |
636 === checking 66f7d451a68b === | 736 === checking 66f7d451a68b === |
637 === checking 01241442b3c2 === | 737 === checking 01241442b3c2 === |
638 === checking 2dc09a01254d === | 738 === checking 2dc09a01254d === |
652 === checking 160a7a0adbf4 === | 752 === checking 160a7a0adbf4 === |
653 === checking a66b68853635 === | 753 === checking a66b68853635 === |
654 === checking 013b27f11536 === | 754 === checking 013b27f11536 === |
655 === checking 4bbfc6078919 === | 755 === checking 4bbfc6078919 === |
656 $ hg showsort --rev 'all()' > ../multiple.source.order | 756 $ hg showsort --rev 'all()' > ../multiple.source.order |
757 $ hg showsorthead --rev '160a7a0adbf4' > ../160a7a0adbf4.source.orderhead | |
758 $ hg showsorthead --rev '4bbfc6078919' > ../4bbfc6078919.multiple.source.orderhead | |
657 $ hg log -r tip | 759 $ hg log -r tip |
658 20 160a7a0adbf4 r20 tip | 760 20 160a7a0adbf4 r20 tip |
659 $ cd .. | 761 $ cd .. |
660 | 762 |
661 $ hg clone recursion_A recursion_random --rev 0 | 763 $ hg clone recursion_A recursion_random --rev 0 |
671 > # using python to benefit from the random seed | 773 > # using python to benefit from the random seed |
672 > hg pull -r $x --quiet | 774 > hg pull -r $x --quiet |
673 > done; | 775 > done; |
674 $ hg pull --quiet | 776 $ hg pull --quiet |
675 $ hg showsort --rev 'all()' > ../multiple.random.order | 777 $ hg showsort --rev 'all()' > ../multiple.random.order |
778 $ hg showsorthead --rev '160a7a0adbf4' > ../160a7a0adbf4.random.orderhead | |
779 $ hg showsorthead --rev '4bbfc6078919' > ../4bbfc6078919.multiple.random.orderhead | |
676 $ python "$RUNTESTDIR/md5sum.py" ../multiple.*.order | 780 $ python "$RUNTESTDIR/md5sum.py" ../multiple.*.order |
677 a6547220a9f004c975e365d9561639dd ../multiple.random.order | 781 a6547220a9f004c975e365d9561639dd ../multiple.random.order |
678 a6547220a9f004c975e365d9561639dd ../multiple.source.order | 782 a6547220a9f004c975e365d9561639dd ../multiple.source.order |
783 $ python "$RUNTESTDIR/md5sum.py" ../160a7a0adbf4.*.orderhead | |
784 48d8911f53869b32e29da26c56e95119 ../160a7a0adbf4.random.orderhead | |
785 48d8911f53869b32e29da26c56e95119 ../160a7a0adbf4.source.orderhead | |
786 $ python "$RUNTESTDIR/md5sum.py" ../4bbfc6078919.*.orderhead | |
787 3732305a333d59ec50b91db0f5ab696e ../4bbfc6078919.multiple.random.orderhead | |
788 3732305a333d59ec50b91db0f5ab696e ../4bbfc6078919.multiple.source.orderhead | |
679 $ hg showsort --rev 'all()' | 789 $ hg showsort --rev 'all()' |
680 1ea73414a91b | 790 1ea73414a91b |
681 66f7d451a68b | 791 66f7d451a68b |
682 01241442b3c2 | 792 01241442b3c2 |
683 2dc09a01254d | 793 2dc09a01254d |
693 4dbf739dd63f | 803 4dbf739dd63f |
694 d64d500024d1 | 804 d64d500024d1 |
695 0496f0a6a143 | 805 0496f0a6a143 |
696 1c645e73dbc6 | 806 1c645e73dbc6 |
697 160a7a0adbf4 | 807 160a7a0adbf4 |
808 a66b68853635 | |
809 013b27f11536 | |
810 4bbfc6078919 | |
811 $ hg showsorthead --rev '160a7a0adbf4' | |
812 1ea73414a91b | |
813 66f7d451a68b | |
814 01241442b3c2 | |
815 2dc09a01254d | |
816 abf57d94268b | |
817 529dfc5bb875 | |
818 e7bd5218ca15 | |
819 6ee532b68cfa | |
820 001194dd78d5 | |
821 3a367db1fabc | |
822 a2f58e9c1e56 | |
823 5f18015f9110 | |
824 9fff0871d230 | |
825 4dbf739dd63f | |
826 d64d500024d1 | |
827 0496f0a6a143 | |
828 1c645e73dbc6 | |
829 160a7a0adbf4 | |
830 $ hg showsorthead --rev '4bbfc6078919' | |
831 1ea73414a91b | |
832 66f7d451a68b | |
833 01241442b3c2 | |
834 2dc09a01254d | |
835 abf57d94268b | |
836 529dfc5bb875 | |
837 e7bd5218ca15 | |
838 6ee532b68cfa | |
839 001194dd78d5 | |
698 a66b68853635 | 840 a66b68853635 |
699 013b27f11536 | 841 013b27f11536 |
700 4bbfc6078919 | 842 4bbfc6078919 |
701 $ cd .. | 843 $ cd .. |
702 | 844 |
748 d20a80d4def3 | 890 d20a80d4def3 |
749 47da0f2c25e2 | 891 47da0f2c25e2 |
750 0dedbcd995b6 | 892 0dedbcd995b6 |
751 ed776db7ed63 | 893 ed776db7ed63 |
752 7f2454f6b04f | 894 7f2454f6b04f |
895 $ hg showsorthead --rev '.' | |
896 d20a80d4def3 | |
897 47da0f2c25e2 | |
898 0dedbcd995b6 | |
899 ed776db7ed63 | |
900 7f2454f6b04f |