1637
1637
([('missing-parent', ), ('ghost', )], [('missing-parent', )]))])
1638
1638
return graph_index
1640
def make_g_index_missing_parent(self):
1641
graph_index = self.make_g_index('missing_parent', 2,
1642
[(('parent', ), ' 100 78', ([], [])),
1643
(('tip', ), ' 100 78',
1644
([('parent', ), ('missing-parent', )], [('parent', )])),
1640
1648
def make_g_index_no_external_refs(self):
1641
1649
graph_index = self.make_g_index('no_external_refs', 2,
1642
1650
[(('rev', ), ' 100 78',
1650
1658
index.scan_unvalidated_index(unvalidated)
1651
1659
self.assertEqual(frozenset(), index.get_missing_compression_parents())
1653
def test_add_incomplete_unvalidated_index(self):
1661
def test_add_missing_compression_parent_unvalidated_index(self):
1654
1662
unvalidated = self.make_g_index_missing_compression_parent()
1655
1663
combined = CombinedGraphIndex([unvalidated])
1656
1664
index = _KnitGraphIndex(combined, lambda: True, deltas=True)
1662
1670
frozenset([('missing-parent',)]),
1663
1671
index.get_missing_compression_parents())
1673
def test_add_missing_noncompression_parent_unvalidated_index(self):
1674
unvalidated = self.make_g_index_missing_parent()
1675
combined = CombinedGraphIndex([unvalidated])
1676
index = _KnitGraphIndex(combined, lambda: True, deltas=True,
1677
track_external_parent_refs=True)
1678
index.scan_unvalidated_index(unvalidated)
1680
frozenset([('missing-parent',)]), index.get_missing_parents())
1682
def test_track_external_parent_refs(self):
1683
g_index = self.make_g_index('empty', 2, [])
1684
combined = CombinedGraphIndex([g_index])
1685
index = _KnitGraphIndex(combined, lambda: True, deltas=True,
1686
add_callback=self.catch_add, track_external_parent_refs=True)
1687
self.caught_entries = []
1689
(('new-key',), 'fulltext,no-eol', (None, 50, 60),
1690
[('parent-1',), ('parent-2',)])])
1692
frozenset([('parent-1',), ('parent-2',)]),
1693
index.get_missing_parents())
1665
1695
def test_add_unvalidated_index_with_present_external_references(self):
1666
1696
index = self.two_graph_index(deltas=True)
1667
1697
# Ugly hack to get at one of the underlying GraphIndex objects that