Debian Codegraph @

tests/test-stabletailgraph.t

raw
1 ====================================
2 Test for the stabletailgraph package
3 ====================================
4
5 This test file contains a bunch of small test graphs with some minimal yet
6 non-trivial structure, on which the various stable-tail graph and stable-tail
7 sort functions are tested.
8
9 Each case consists of the creation of the interesting graph structure, followed
10 by a check, for each noteworthy node, of:
11 - the stable-tail sort output (with the linear parts globbed),
12 - the leap set,
13 - the specific leap set.
14
15 In the ASCII art of the diagrams, the side of the exclusive part which is
16 followed in priority is denoted with "<" or ">" if it is on the left or right
17 respectively.
18
19 The intermediary linear parts in the example graph are there to force the
20 exclusive part choice (made on a min rank condition).
21
22
23 Setup
24 =====
25
26 Enable the rank computation to test sorting based on the rank.
27
28 $ cat << EOF >> $HGRCPATH
29 > [format]
30 > exp-use-changelog-v2=enable-unstable-format-and-corrupt-my-data
31 >
32 > [alias]
33 > test-sts = debug::stable-tail-sort -T '{tags},'
34 > test-leaps = debug::stable-tail-sort-leaps -T '{tags}'
35 > test-log = log --graph -T '{tags} rank={_fast_rank}' --rev 'tagged()'
36 > EOF
37
38
39 Example 1: single merge node
40 ============================
41
42 A base case with one branchpoint "b" and one merge node "e".
43
44 The exclusive part, starting with the lowest-ranking parent "c" of "e",
45 appears first in stable-tail sort of "e" and "f".
46
47 # f
48 # |
49 # e
50 # |
51 # --<--
52 # | |
53 # c d
54 # | |
55 # --+-- <- at this point, the sort of "e" is done consuming its
56 # | exclusive part [c] and jumps back to its other parent "d"
57 # b
58 # |
59 # a
60
61 $ hg init example-1
62 $ cd example-1
63 $ hg debugbuilddag '.:a*a:b*b:c<b+2:d*c/d:e*e:f.'
64 $ hg test-log
65 o f rank=7
66 |
67 o e rank=6
68 |\
69 | o d rank=4
70 | :
71 o : c rank=3
72 :/
73 o b rank=2
74 |
75 o a rank=1
76
77
78 Check the sort of the base linear case.
79
80 $ hg test-sts c
81 c,b,a, (no-eol)
82
83 Check the stable-tail sort of "e": "c" should come before "d".
84
85 $ hg test-sts e
86 e,c,d,*,b,a, (no-eol) (glob)
87
88 Check that the linear descendant of the merge inherits its sort properly.
89
90 $ hg test-sts f
91 f,e,c,d,*,b,a, (no-eol) (glob)
92
93 Check the leaps of "e": arriving at "c", the sort continues at "d", which
94 which breaks the child-parent chain and results in a leap.
95
96 $ hg test-leaps e
97 cd
98
99 Check that this leap is indeed specific to "e", i.e. that it appears in its
100 stable-tail sort, but not in any stable-tail sort of its ancestors.
101
102 $ hg test-leaps --specific e
103
104 Check that this leap is inherited by its direct ancestor "f".
105
106 $ hg test-leaps f
107 cd
108
109 Check that this leap is not classified as specific to "f", since it is specific
110 to "e".
111
112 $ hg test-leaps --specific f
113
114 $ cd ..
115
116
117 Example 2: nested exclusive parts, without specific leap
118 ========================================================
119
120 "g" is a merge node whose exclusive part contains a merge node "e".
121 We check that the stable-tail sort recurses properly by delegating.
122
123 Notice that parts of the sort of "e" is an infix of the sort of "g".
124 This is an expected property of the sort.
125
126 # g
127 # |
128 # ---<---
129 # | |
130 # e | <- while processing the sort in the exclusive part of "g"
131 # | | we recursively process the exclusive part of "e"
132 # --<-- f
133 # | | |
134 # c d |
135 # | | |
136 # --+-- |
137 # | |
138 # b |
139 # | |
140 # ---+--- <- done with excl(g), jump to "f"
141 # |
142 # a
143
144 $ hg init example-2
145 $ cd example-2
146 $ hg debugbuilddag '.:a*a:b*b:c<b+2:d*c/d:e<a+6:f*e/f:g.'
147 $ hg test-log
148 o g rank=13
149 |\
150 | o f rank=7
151 | :
152 o : e rank=6
153 |\ \
154 | o : d rank=4
155 | : :
156 o : : c rank=3
157 :/ /
158 o / b rank=2
159 :/
160 o a rank=1
161
162 Display the sort of "e" for reference
163
164 $ hg test-sts e
165 e,c,d,*,b,a, (no-eol) (glob)
166
167 Check the correctness of the sort of "g",
168 and that a part of the sort of "e" appears as an infix.
169
170 $ hg test-sts g
171 g,e,c,d,*,b,f,*,a, (no-eol) (glob)
172
173 Check the leaps of "e".
174
175 $ hg test-leaps e
176 cd
177
178 $ hg test-leaps --specific e
179
180 Check that "g" inherits a leap from "e" in addition of its own.
181
182 $ hg test-leaps g
183 cd
184 bf
185
186 Check that only the additional leap of "g" is classified as specific.
187
188 $ hg test-leaps --specific g
189
190 $ cd ..
191
192
193 Example 3: shadowing of a final leap
194 ====================================
195
196 We have a merge "f" whose exclusive part contains a merge "d".
197
198 The inherited parent of "d" is not in the exclusive part of "f".
199 At the end of the exclusive part of "d",
200 the leap to "c" is shadowed by the leap to "e", i.e. the inherited part to "f".
201
202 Notice that emitting "c" before "e" would break the reverse topological
203 ordering.
204
205 # f
206 # |
207 # ---<---
208 # | |
209 # d |
210 # | e
211 # --<-- |
212 # | | |
213 # | +----
214 # b |
215 # | c
216 # | |
217 # --+-- <- at this point, jumping to "e", not the shadowed "c"
218 # |
219 # a
220
221 $ hg init example-3
222 $ cd example-3
223 $ hg debugbuilddag '.:a*a:b<a+2:c*b/c:d<c+3:e*d/e:f.'
224 $ hg test-log
225 o f rank=9
226 |\
227 | o e rank=6
228 | :
229 o : d rank=5
230 |\:
231 | o c rank=3
232 | :
233 o : b rank=2
234 :/
235 o a rank=1
236
237
238 Display the sort of "d" for reference:
239
240 $ hg test-sts d
241 d,b,c,*,a, (no-eol) (glob)
242
243 Check that we leap from "b" directly to "e" (shadowing the leap to "c"),
244 and that "c" is then emitted after "e" (its descendant).
245
246 $ hg test-sts f
247 f,d,b,e,*,c,*,a, (no-eol) (glob)
248
249 Check the leaps of "d".
250
251 $ hg test-leaps d
252 bc
253
254 $ hg test-leaps --specific d
255
256 Check thet leaps of "f", which, despite being a descendant of "f", has a
257 different stable-tail sort which does not reuse any leap of "d".
258
259 $ hg test-leaps f
260 be
261
262 $ hg test-leaps --specific f
263
264 $ cd ..
265
266
267 Example 4: skipping over nested exclusive part (entirely)
268 =========================================================
269
270 We have a merge "f" whose exclusive part contains a merge "d".
271
272 The exclusive part of "d" is not in the exclusive part of "f".
273 However, some of the inherited part of "d" is part of the exclusive part of "f"
274 and needs to be iterated over before leaping to the inherited part of "f".
275
276 The sort of "d" is partially reused for the ordering of the exclusive part of
277 "f". However the reused part is not contiguous in the sort of "d".
278
279 # f
280 # |
281 # ---<---
282 # | |
283 # d |
284 # | e
285 # -->-- | <- in the sort of "f", we need to skip "c" and leap to the
286 # | | | inherited part of "d"
287 # | +----
288 # b |
289 # | c
290 # | |
291 # --+--
292 # |
293 # a
294
295 $ hg init example-4
296 $ cd example-4
297 $ hg debugbuilddag '.:a*a+1:b<a+1:c*b/c:d<c+4:e*d/e:f.'
298 $ hg test-log
299 o f rank=10
300 |\
301 | o e rank=6
302 | :
303 o : d rank=5
304 |\:
305 | o c rank=2
306 | |
307 o | b rank=3
308 |/
309 o a rank=1
310
311
312 Display the sort of "d" for reference:
313
314 $ hg test-sts d
315 d,c,b,*,a, (no-eol) (glob)
316
317 Check that sort "f" leaps from "d" to "b":
318
319 $ hg test-sts f
320 f,d,b,*,e,*,c,a, (no-eol) (glob)
321
322 Check the leaps of "d".
323
324 $ hg test-leaps d
325 cb
326
327 $ hg test-leaps --specific d
328
329 Check the leaps of "f".
330
331 $ hg test-leaps f
332 db
333 e* (glob)
334
335 $ hg test-leaps --specific f
336 db
337
338 $ cd ..
339
340
341 Example 5: skipping over nested exclusive part (partially)
342 ==========================================================
343
344 We have a merge "f" whose exclusive part contains a merge "d".
345
346 Similar to example 4, but the exclusive part of "d" is only partially
347 contained in the inherited part of "f".
348 So, we need to leap in the middle of the exclusive part of "d".
349
350 # f
351 # |
352 # ---<---
353 # | |
354 # d |
355 # | e
356 # -->-- |
357 # | | |
358 # | g |
359 # | | |
360 # | +---- <- in the sort of "f", leaping from "g" to "b"
361 # b |
362 # | c
363 # | |
364 # --+--
365 # |
366 # a
367
368 $ hg init example-5
369 $ cd example-5
370 $ hg debugbuilddag '.:a*a+2:b<a+1:c+1:g*b/g:d<c+6:e*d/e:f.'
371 $ hg test-log
372 o f rank=14
373 |\
374 | o e rank=8
375 | :
376 o : d rank=7
377 |\ \
378 | o : g rank=3
379 | :/
380 | o c rank=2
381 | |
382 o | b rank=4
383 |/
384 o a rank=1
385
386
387 Display the sort of "d" for reference:
388
389 $ hg test-sts d
390 d,g,c,b,*,a, (no-eol) (glob)
391
392 Check that sort "f" leaps from "g" to "b":
393
394 $ hg test-sts f
395 f,d,g,b,*,e,*,c,a, (no-eol) (glob)
396
397 Check the leaps of "d".
398
399 $ hg test-leaps d
400 cb
401 $ hg test-leaps --specific d
402
403 Check the leaps of "f".
404
405 $ hg test-leaps f
406 gb
407 e* (glob)
408
409 $ hg test-leaps --specific f
410 gb
411
412 $ cd ..
413
414
415 Example 6: merge in the inherited part
416 ======================================
417
418 Variant of example 2, but with a merge ("f") in the inherited part of "g".
419
420 "g" is a merge node whose inherited part contains a merge node "f".
421 We check that the stable-tail sort delegates properly after the exclusive part.
422
423 # g
424 # |
425 # ---<---
426 # | |
427 # d f
428 # | |
429 # | ---<---
430 # | | |
431 # | e c
432 # | | |
433 # ---+ | <- at this point, we're done (for good) with the exclusive
434 # | | part of "g"
435 # b |
436 # | |
437 # ---+---
438 # |
439 # a
440
441 $ hg init example-6
442 $ cd example-6
443 $ hg debugbuilddag '.:a*a:b<a+3:c*b:d*b:e*e/c:f*d/f:g.'
444 $ hg test-log
445 o g rank=9
446 |\
447 | o f rank=7
448 | |\
449 | | o e rank=3
450 | | |
451 o---+ d rank=3
452 / /
453 o | c rank=4
454 : |
455 : o b rank=2
456 :/
457 o a rank=1
458
459
460 Display the sort of "f" for reference:
461
462 $ hg test-sts f
463 f,e,b,c,*,a, (no-eol) (glob)
464
465 Check that the sort of "g" delegates to the sort of "f" after processing its
466 exclusive part of "g":
467
468 $ hg test-sts g
469 g,d,f,e,b,c,*,a, (no-eol) (glob)
470
471 Check the leaps of "f".
472
473 $ hg test-leaps f
474 bc
475
476 $ hg test-leaps --specific f
477
478 Check the leaps of "g".
479
480 $ hg test-leaps g
481 df
482 bc
483
484 $ hg test-leaps --specific g
485
486 $ cd ..
487
488
489 Example 7: postponed iteration of common exclusive ancestors
490 ============================================================
491
492 Sibling merges "j" and "k", with partially shared exclusive parts.
493
494 When considering the sort of "l", the iteration over this shared part cannot
495 happen when iterating over excl(j) and has to be postponed to excl(k).
496
497 # l
498 # |
499 # ----<----
500 # | |
501 # j k
502 # | |
503 # -->-- --<--
504 # | | | |
505 # g e h i
506 # | | | |
507 # | --+-- | <- at this point, for the sort of "l", the iteration on
508 # f | | the end of excl(j) is postponed to the iteration of
509 # | d | excl(k)
510 # | | |
511 # | c |
512 # | | |
513 # ---+--- |
514 # | |
515 # b |
516 # | |
517 # ----+-----
518 # |
519 # a
520
521 $ hg init example-7
522 $ cd example-7
523 $ hg debugbuilddag \
524 > '.:a*a:b*b:c*c:d*d:e*b:f<f+3:g<d+2:h<a+6:i*e/g:j*h/i:k*j/k:l.'
525 $ hg test-log
526 o l rank=20
527 |\
528 | o k rank=13
529 | |\
530 o \ \ j rank=10
531 |\ \ \
532 | | | o i rank=7
533 | | | :
534 | | o : h rank=6
535 | | : :
536 | o : : g rank=6
537 | : : :
538 | o : : f rank=3
539 | | : :
540 o---+ : e rank=5
541 / / /
542 | o : d rank=4
543 | | :
544 | o : c rank=3
545 |/ /
546 o / b rank=2
547 :/
548 o a rank=1
549
550
551 Display the sort of "j" for reference:
552
553 $ hg test-sts j
554 j,e,d,c,g,*,f,b,a, (no-eol) (glob)
555
556 Display the sort of "k" for reference:
557
558 $ hg test-sts k
559 k,h,*,d,c,b,i,*,a, (no-eol) (glob)
560
561 Check that the common part of excl(j) and excl(k) is iterated over after "k":
562
563 $ hg test-sts l
564 l,j,e,g,*,f,k,h,*,d,c,b,i,*,a, (no-eol) (glob)
565
566 Check the leaps of "j".
567
568 $ hg test-leaps j
569 cg
570
571 $ hg test-leaps --specific j
572
573 Check the leaps of "k".
574
575 $ hg test-leaps k
576 bi
577
578 $ hg test-leaps --specific k
579
580 Check the leaps of "l".
581
582 $ hg test-leaps l
583 eg
584 fk
585 bi
586
587 $ hg test-leaps --specific l
588 eg
589
590 $ cd ..
591
592
593 Example 8: postponed iteration of common ancestors between parts
594 ================================================================
595
596 Sibling merges "g" and "i", with some part shared between the inherited part
597 of "g" and the exclusive part of "i".
598
599 When considering the sort of "j", the iteration over this shared part cannot
600 happen when iterating over inherited(g) and has to be postponed to excl(i).
601
602 # j
603 # |
604 # ----<----
605 # | |
606 # g i
607 # | |
608 # --<-- --<--
609 # | | | |
610 # c f | h
611 # | | | |
612 # | --+-- | <- at this point, for the sort of "j", the iteration
613 # | | | on the end of inherited(g) is postponed to the
614 # | e | iteration of excl(k)
615 # | | |
616 # ---+--- |
617 # b |
618 # | |
619 # ----+-----
620 # |
621 # a
622
623 $ hg init example-8
624 $ cd example-8
625 $ hg debugbuilddag '.:a*a:b*b:c*b:d*d:e*e:f*c/f:g<a+5:h*e/h:i*g/i:j.'
626 $ hg test-log
627 o j rank=14
628 |\
629 | o i rank=10
630 | |\
631 | | o h rank=6
632 | | :
633 o | : g rank=7
634 |\ \ \
635 | o | : f rank=5
636 | |/ /
637 | o : e rank=4
638 | | :
639 | o : d rank=3
640 | | :
641 o | : c rank=3
642 |/ /
643 o / b rank=2
644 :/
645 o a rank=1
646
647
648 Display the sort of "g" for reference:
649
650 $ hg test-sts g
651 g,c,f,e,d,b,a, (no-eol)
652
653 Display the sort of "i" for reference:
654
655 $ hg test-sts i
656 i,e,d,b,h,*,a, (no-eol) (glob)
657
658 Check that the common part of inherited(g) and excl(k) is iterated over after
659 "i":
660
661 $ hg test-sts j
662 j,g,c,f,i,e,d,b,h,*,a, (no-eol) (glob)
663
664 Check the leaps of "g".
665
666 $ hg test-leaps g
667 cf
668 $ hg test-leaps g
669 cf
670
671 Check the leaps of "i".
672
673 $ hg test-leaps i
674 bh
675
676 $ hg test-leaps --specific i
677
678 Check the leaps of "j".
679
680 $ hg test-leaps j
681 cf
682 fi
683 bh
684
685 $ hg test-leaps --specific j
686
687 $ cd ..
688
689
690 Example 9: postponed iteration of common ancestors between both parts
691 =====================================================================
692
693 This is a combination of example 7 and 8 at the same time.
694 Both excl(i) and excl(j) share a common part.
695 Same with inherited(i) and inherited(j).
696
697 We test that the walk on the common ancestors in both cases is properly
698 postponed when considering sort(k).
699
700 # k
701 # |
702 # ----<----
703 # | |
704 # i j
705 # | |
706 # --<-- --<--
707 # | | | |
708 # c f g h
709 # | | | |
710 # | e | |
711 # | | | |
712 # +--]|[--- | <- rest of excl(i) postponed to excl(j)
713 # | | |
714 # b ----+---- <- rest of inherited(i) postponed to inherited(j)
715 # | |
716 # | d
717 # | |
718 # ----+----
719 # |
720 # a
721
722 $ hg init example-9
723 $ cd example-9
724 $ hg debugbuilddag '.:a*a:b*b:c*a:d*d:e*e:f<b+2:g<d+3:h*c/f:i*g/h:j*i/j:k.'
725 $ hg test-log
726 o k rank=14
727 |\
728 | o j rank=9
729 | |\
730 o \ \ i rank=7
731 |\ \ \
732 | | | o h rank=5
733 | | | :
734 | | o : g rank=4
735 | | : :
736 | o : : f rank=4
737 | | : :
738 | o---+ e rank=3
739 | / /
740 | : o d rank=2
741 | : |
742 o : | c rank=3
743 :/ /
744 o / b rank=2
745 |/
746 o a rank=1
747
748
749 Display sort(i) for reference:
750
751 $ hg test-sts i
752 i,c,b,f,e,d,a, (no-eol)
753
754 Display sort(j) for reference:
755
756 $ hg test-sts j
757 j,g,*,b,h,*,d,a, (no-eol) (glob)
758
759 Check that the end of excl(i) is postponed to excl(j), the end of inherited(i)
760 is postponed to inherited(j) in sort(k):
761
762 $ hg test-sts k
763 k,i,c,f,e,j,g,*,b,h,*,d,a, (no-eol) (glob)
764
765 Check the leaps of "i".
766
767 $ hg test-leaps i
768 bf
769
770 $ hg test-leaps --specific i
771
772 Check the leaps of "j".
773
774 $ hg test-leaps j
775 bh
776
777 $ hg test-leaps --specific j
778
779 Check the leaps of "k".
780
781 $ hg test-leaps k
782 cf
783 ej
784 bh
785
786 $ hg test-leaps --specific k
787 cf
788
789 $ cd ..
790
791
792 Example 10: adjusting other leaps
793 =================================
794
795 This test checks the adjustment of leaps attached to other open merges in the
796 stack.
797
798 # o
799 # |
800 # ------>------
801 # | |
802 # n l
803 # | |
804 # | ----<----
805 # | | |
806 # | i k
807 # m | |
808 # | ---<--- |
809 # | | | |
810 # | d h |
811 # | | | j
812 # | | g |
813 # | c | |
814 # | | +-----
815 # -----+ |
816 # | f
817 # b |
818 # | e <- Done with excl(o) by element count, without
819 # | | having emitted "b". Implicitly unstack open
820 # ---+--- merges to leap e->n.
821 # |
822 # a
823
824 $ hg init example-10
825 $ cd example-10
826 $ hg debugbuilddag '
827 > .:a
828 > *a:b.:c.:d
829 > *a:e.:f.:g.:h
830 > *d/h:i
831 > *f:j+6:k
832 > *i/k:l
833 > *b:m+15:n
834 > *n/l:o.
835 > '
836 $ hg test-log
837 o o rank=34
838 |\
839 | o n rank=18
840 | :
841 | o m rank=3
842 | |
843 o | l rank=17
844 |\ \
845 | o | k rank=10
846 | : |
847 | o | j rank=4
848 | | |
849 o | | i rank=9
850 |\ \ \
851 | o | | h rank=5
852 | | | |
853 | o | | g rank=4
854 | |/ /
855 | o | f rank=3
856 | | |
857 | o | e rank=2
858 | | |
859 o | | d rank=4
860 | | |
861 o---+ c rank=3
862 / /
863 | o b rank=2
864 |/
865 o a rank=1
866
867
868 Check the stable-tail sort of "o":
869
870 $ hg test-sts o
871 o,l,i,d,c,h,g,k,*,j,f,e,n,*,m,b,a, (no-eol) (glob)
872
873 Stale-tail sort of "l" for reference:
874
875 $ hg test-sts l
876 l,i,d,c,b,h,g,k,*,j,f,e,a, (no-eol) (glob)
877
878 Check the corresponding leaps:
879
880 $ hg test-leaps o
881 ch
882 gk
883 en
884
885 $ hg test-leaps --specific o
886 ch
887
888 $ hg test-leaps l
889 bh
890 gk
891
892 $ hg test-leaps --specific l
893
894 $ cd ..
895
896
897 Example 11: adjusting other leaps with the same destination
898 ===========================================================
899
900 This is a variant of the previous test, checking the adjustment of leaps having
901 the same destination in particular.
902
903 # r
904 # |
905 # ------>------
906 # | |
907 # | o
908 # q |
909 # | ------>------
910 # | | |
911 # | n l
912 # | | |
913 # | | ----<----
914 # p | | |
915 # | | i k
916 # | m | |
917 # | | ---<--- |
918 # | | | | |
919 # | | d h |
920 # | | | | j
921 # -----]|[---+ | | <- in sts(r): leap d->h
922 # | | g |
923 # | c | |
924 # | | +-----
925 # -----+ | <- the leap c->h of sts(o)
926 # | f is shadowed in sts(r)
927 # b |
928 # | e
929 # | |
930 # ---+---
931 # |
932 # a
933
934 $ hg init example-11
935 $ cd example-11
936 $ hg debugbuilddag '
937 > .:a
938 > *a:b.:c.:d
939 > *a:e.:f.:g.:h
940 > *d/h:i
941 > *f:j+6:k
942 > *i/k:l
943 > *b:m+15:n
944 > *n/l:o
945 > *c:p+31:q
946 > *o/q:r.
947 > '
948 $ hg test-log
949 o r rank=67
950 |\
951 | o q rank=35
952 | :
953 | o p rank=4
954 | |
955 o | o rank=34
956 |\ \
957 | o | n rank=18
958 | : |
959 | o | m rank=3
960 | | |
961 o | | l rank=17
962 |\ \ \
963 | o | | k rank=10
964 | : | |
965 | o | | j rank=4
966 | | | |
967 o | | | i rank=9
968 |\ \ \ \
969 | o | | | h rank=5
970 | | | | |
971 | o | | | g rank=4
972 | |/ / /
973 | o | | f rank=3
974 | | | |
975 | o | | e rank=2
976 | | | |
977 o-----+ d rank=4
978 / / /
979 | | o c rank=3
980 | |/
981 | o b rank=2
982 |/
983 o a rank=1
984
985
986 Check the stable-tail sort of "r":
987
988 $ hg test-sts r
989 r,o,l,i,d,h,g,k,*,j,f,e,n,*,m,q,*,p,c,b,a, (no-eol) (glob)
990
991 Stable-tail sort of "o" for reference:
992
993 $ hg test-sts o
994 o,l,i,d,c,h,g,k,*,j,f,e,n,*,m,b,a, (no-eol) (glob)
995
996 Check the associated leaps:
997
998 $ hg test-leaps r
999 dh
1000 gk
1001 en
1002 mq
1003
1004 $ hg test-leaps --specific r
1005 dh
1006
1007 $ hg test-leaps o
1008 ch
1009 gk
1010 en
1011
1012 $ hg test-leaps --specific o
1013 ch
1014
1015 $ cd ..
1016
1017
1018 Example 12
1019 ==========
1020
1021 This is a variant of the previous test, checking the adjustments of leaps
1022 in the open merge stack having a lower destination (which should appear only
1023 later in the stable-tail sort of the head).
1024
1025 # t
1026 # |
1027 # ------>------
1028 # | |
1029 # | o
1030 # s |
1031 # | ------>------
1032 # | | |
1033 # | n l
1034 # r | |
1035 # | | ----<----
1036 # | | | |
1037 # --<-- | i k
1038 # | | m | |
1039 # p q | ---<--- |
1040 # | | | | | |
1041 # | ---]|[--]|[----+ |
1042 # | | | | |
1043 # | | d h |
1044 # | | | | j
1045 # -------]|[---+ | | <- d->k is sts(t)
1046 # | | g |
1047 # | c | |
1048 # | | +-----
1049 # -----+ | <- c->h in sts(o), not applying in sts(t)
1050 # | f
1051 # b |
1052 # | e
1053 # | |
1054 # ---+---
1055 # |
1056 # a
1057
1058 $ hg init example-12
1059 $ cd example-12
1060 $ hg debugbuilddag '
1061 > .:a
1062 > *a:b.:c.:d
1063 > *a:e.:f.:g.:h
1064 > *d/h:i
1065 > *f:j+6:k
1066 > *i/k:l
1067 > *b:m+15:n
1068 > *n/l:o
1069 > *c:p
1070 > *h:q
1071 > *p/q:r+25:s
1072 > *o/s:t.
1073 > '
1074 $ hg test-log
1075 o t rank=63
1076 |\
1077 | o s rank=35
1078 | :
1079 | o r rank=10
1080 | |\
1081 | | o q rank=6
1082 | | |
1083 | o | p rank=4
1084 | | |
1085 o | | o rank=34
1086 |\ \ \
1087 | o | | n rank=18
1088 | : | |
1089 | o | | m rank=3
1090 | | | |
1091 o | | | l rank=17
1092 |\ \ \ \
1093 | o | | | k rank=10
1094 | : | | |
1095 | o | | | j rank=4
1096 | | | | |
1097 o-------+ i rank=9
1098 | | | | |
1099 | | | | o h rank=5
1100 | | | | |
1101 | +-----o g rank=4
1102 | | | |
1103 | o | | f rank=3
1104 | | | |
1105 | o | | e rank=2
1106 | | | |
1107 o-----+ d rank=4
1108 / / /
1109 | | o c rank=3
1110 | |/
1111 | o b rank=2
1112 |/
1113 o a rank=1
1114
1115
1116 Check the stable-tail sort of "t":
1117
1118 $ hg test-sts t
1119 t,o,l,i,d,k,*,j,n,*,m,s,*,r,p,c,b,q,h,g,f,e,a, (no-eol) (glob)
1120
1121 Stable-tail sort of "o" for reference:
1122
1123 $ hg test-sts o
1124 o,l,i,d,c,h,g,k,*,j,f,e,n,*,m,b,a, (no-eol) (glob)
1125
1126 Check the associated leaps:
1127
1128 $ hg test-leaps t
1129 dk
1130 jn
1131 ms
1132 bq
1133
1134 $ hg test-leaps --specific t
1135 dk
1136 jn
1137
1138 $ hg test-leaps o
1139 ch
1140 gk
1141 en
1142
1143 $ hg test-leaps --specific o
1144 ch
1145
1146 $ cd ..