98
98
def assertSortAndIterate(self, graph, branch_tip, result_list,
99
99
generate_revno, mainline_revisions=None):
100
100
"""Check that merge based sorting and iter_topo_order on graph works."""
101
value = merge_sort(graph, branch_tip,
102
mainline_revisions=mainline_revisions,
103
generate_revno=generate_revno)
104
if result_list != value:
106
self.assertEqualDiff(pprint.pformat(result_list),
107
pprint.pformat(value))
101
108
self.assertEquals(result_list,
102
109
merge_sort(graph, branch_tip, mainline_revisions=mainline_revisions,
103
110
generate_revno=generate_revno))
616
def test_roots_and_sub_branches_versus_ghosts(self):
617
"""Extra roots and their mini branches use the same numbering.
619
All of them use the 0-node numbering.
632
self.assertSortAndIterate(
653
[( 0, 'R', 0, (6,), False),
654
( 1, 'Q', 1, (0,4,5), False),
655
( 2, 'P', 2, (0,6,1), True),
656
( 3, 'O', 1, (0,4,4), False),
657
( 4, 'N', 1, (0,4,3), False),
658
( 5, 'M', 2, (0,5,1), True),
659
( 6, 'L', 1, (0,4,2), False),
660
( 7, 'K', 1, (0,4,1), True),
661
( 8, 'J', 0, (5,), False),
662
( 9, 'I', 1, (0,3,1), True),
663
(10, 'H', 0, (4,), False),
664
(11, 'G', 1, (0,1,3), False),
665
(12, 'F', 2, (0,2,1), True),
666
(13, 'E', 1, (0,1,2), False),
667
(14, 'D', 1, (0,1,1), True),
668
(15, 'C', 0, (3,), False),
669
(16, 'B', 0, (2,), False),
670
(17, 'A', 0, (1,), True),