==================================== Test for the stabletailgraph package ==================================== This test file contains a bunch of small test graphs with some minimal yet non-trivial structure, on which the various stable-tail graph and stable-tail sort functions are tested. Each case consists of the creation of the interesting graph structure, followed by a check, for each noteworthy node, of: - the stable-tail sort output. In the ASCII art of the diagrams, the side of the exclusive part which is followed in priority is denoted with "<" or ">" if it is on the left or right respectively. The intermediary linear parts in the example graph are there to force the exclusive part choice (made on a min rank condition). Setup ===== Enable the rank computation to test sorting based on the rank. $ cat << EOF >> $HGRCPATH > [format] > exp-use-changelog-v2=enable-unstable-format-and-corrupt-my-data > > [alias] > test-sts = debug::stable-tail-sort -T '{tags},' > test-log = log --graph -T '{tags} rank={_fast_rank}' > EOF Example 1: single merge node ============================ A base case with one branchpoint "b" and one merge node "e". The exclusive part, starting with the lowest-ranking parent "c" of "e", appears first in stable-tail sort of "e" and "f". # f # | # e # | # --<-- # | | # c d # | | # --+-- <- at this point, the sort of "e" is done consuming its # | exclusive part [c] and jumps back to its other parent "d" # b # | # a $ hg init example-1 $ cd example-1 $ hg debugbuilddag '.:a*a:b*b:c-- | <- in the sort of "f", we need to skip "c" and leap to the # | | | inherited part of "d" # | +---- # b | # | c # | | # --+-- # | # a $ hg init example-4 $ cd example-4 $ hg debugbuilddag '.:a*a+1:b-- | # | | | # | g | # | | | # | +---- <- in the sort of "f", leaping from "g" to "b" # b | # | c # | | # --+-- # | # a $ hg init example-5 $ cd example-5 $ hg debugbuilddag '.:a*a+2:b-- --<-- # | | | | # g e h i # | | | | # | --+-- | <- at this point, for the sort of "l", the iteration on # f | | the end of excl(j) is postponed to the iteration of # | d | excl(k) # | | | # | c | # | | | # ---+--- | # | | # b | # | | # ----+----- # | # a $ hg init example-7 $ cd example-7 $ hg debugbuilddag \ > '.:a*a:b*b:c*c:d*d:e*b:f