/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test_knit.py

  • Committer: Martin
  • Date: 2018-06-30 22:18:39 UTC
  • mfrom: (7010 work)
  • mto: This revision was merged to the branch mainline in revision 7012.
  • Revision ID: gzlist@googlemail.com-20180630221839-98zi78xwcggestse
Merge trunk to fix conflict

Show diffs side-by-side

added added

removed removed

Lines of Context:
1849
1849
            add_callback=self.catch_add, track_external_parent_refs=True)
1850
1850
        self.caught_entries = []
1851
1851
        index.add_records([
1852
 
            (('new-key',), 'fulltext,no-eol', (None, 50, 60),
1853
 
             [('parent-1',), ('parent-2',)])])
 
1852
            ((b'new-key',), b'fulltext,no-eol', (None, 50, 60),
 
1853
             [(b'parent-1',), (b'parent-2',)])])
1854
1854
        self.assertEqual(
1855
 
            frozenset([('parent-1',), ('parent-2',)]),
 
1855
            frozenset([(b'parent-1',), (b'parent-2',)]),
1856
1856
            index.get_missing_parents())
1857
1857
 
1858
1858
    def test_add_unvalidated_index_with_present_external_references(self):
1866
1866
        self.assertEqual(frozenset(), index.get_missing_compression_parents())
1867
1867
 
1868
1868
    def make_new_missing_parent_g_index(self, name):
1869
 
        missing_parent = name + '-missing-parent'
 
1869
        missing_parent = name.encode('ascii') + b'-missing-parent'
1870
1870
        graph_index = self.make_g_index(name, 2,
1871
 
            [((name + 'tip', ), ' 100 78',
1872
 
              ([(missing_parent, ), ('ghost', )], [(missing_parent, )]))])
 
1871
            [((name + b'tip', ), ' 100 78',
 
1872
              ([(missing_parent, ), (b'ghost', )], [(missing_parent, )]))])
1873
1873
        return graph_index
1874
1874
 
1875
1875
    def test_add_mulitiple_unvalidated_indices_with_missing_parents(self):
1880
1880
        index.scan_unvalidated_index(g_index_1)
1881
1881
        index.scan_unvalidated_index(g_index_2)
1882
1882
        self.assertEqual(
1883
 
            frozenset([('one-missing-parent',), ('two-missing-parent',)]),
 
1883
            frozenset([(b'one-missing-parent',), (b'two-missing-parent',)]),
1884
1884
            index.get_missing_compression_parents())
1885
1885
 
1886
1886
    def test_add_mulitiple_unvalidated_indices_with_mutual_dependencies(self):
1887
1887
        graph_index_a = self.make_g_index('one', 2,
1888
 
            [(('parent-one', ), ' 100 78', ([('non-compression-parent',)], [])),
1889
 
             (('child-of-two', ), ' 100 78',
1890
 
              ([('parent-two',)], [('parent-two',)]))])
 
1888
            [((b'parent-one', ), b' 100 78', ([(b'non-compression-parent',)], [])),
 
1889
             ((b'child-of-two', ), b' 100 78',
 
1890
              ([(b'parent-two',)], [(b'parent-two',)]))])
1891
1891
        graph_index_b = self.make_g_index('two', 2,
1892
 
            [(('parent-two', ), ' 100 78', ([('non-compression-parent',)], [])),
1893
 
             (('child-of-one', ), ' 100 78',
1894
 
              ([('parent-one',)], [('parent-one',)]))])
 
1892
            [((b'parent-two', ), b' 100 78', ([(b'non-compression-parent',)], [])),
 
1893
             ((b'child-of-one', ), b' 100 78',
 
1894
              ([(b'parent-one',)], [(b'parent-one',)]))])
1895
1895
        combined = CombinedGraphIndex([graph_index_a, graph_index_b])
1896
1896
        index = _KnitGraphIndex(combined, lambda: True, deltas=True)
1897
1897
        index.scan_unvalidated_index(graph_index_a)