/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 bzrlib/tests/test_versionedfile.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-03-28 06:42:20 UTC
  • mfrom: (3287.6.9 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20080328064220-ongijg78bfqhvbay
Deprecate a number of VersionedFile method calls,
        and Repository.get_revision_graph. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
630
630
            vf.add_lines_with_ghosts('notbxbfse', [parent_id_utf8], [])
631
631
        except NotImplementedError:
632
632
            # check the other ghost apis are also not implemented
633
 
            self.assertRaises(NotImplementedError, vf.has_ghost, 'foo')
634
633
            self.assertRaises(NotImplementedError, vf.get_ancestry_with_ghosts, ['foo'])
635
634
            self.assertRaises(NotImplementedError, vf.get_parents_with_ghosts, 'foo')
636
 
            self.assertRaises(NotImplementedError, vf.get_graph_with_ghosts)
637
635
            return
638
636
        vf = self.reopen_file()
639
637
        # test key graph related apis: getncestry, _graph, get_parents
647
645
        # we have _with_ghost apis to give us ghost information.
648
646
        self.assertEqual([parent_id_utf8, 'notbxbfse'], vf.get_ancestry_with_ghosts(['notbxbfse']))
649
647
        self.assertEqual([parent_id_utf8], vf.get_parents_with_ghosts('notbxbfse'))
650
 
        self.assertEqual({'notbxbfse':(parent_id_utf8,)}, vf.get_graph_with_ghosts())
651
 
        self.assertTrue(vf.has_ghost(parent_id_utf8))
 
648
        self.assertEqual({'notbxbfse':(parent_id_utf8,)},
 
649
            self.applyDeprecated(one_four, vf.get_graph_with_ghosts))
 
650
        self.assertTrue(self.applyDeprecated(one_four, vf.has_ghost,
 
651
            parent_id_utf8))
652
652
        # if we add something that is a ghost of another, it should correct the
653
653
        # results of the prior apis
654
654
        vf.add_lines(parent_id_utf8, [], [])
667
667
        self.assertEqual({parent_id_utf8:(),
668
668
                          'notbxbfse':(parent_id_utf8,),
669
669
                          },
670
 
                         vf.get_graph_with_ghosts())
671
 
        self.assertFalse(vf.has_ghost(parent_id_utf8))
 
670
            self.applyDeprecated(one_four, vf.get_graph_with_ghosts))
 
671
        self.assertFalse(self.applyDeprecated(one_four, vf.has_ghost,
 
672
            parent_id_utf8))
672
673
 
673
674
    def test_add_lines_with_ghosts_after_normal_revs(self):
674
675
        # some versioned file formats allow lines to be added with parent
678
679
        vf = self.get_file()
679
680
        # probe for ghost support
680
681
        try:
681
 
            vf.has_ghost('hoo')
 
682
            vf.add_lines_with_ghosts('base', [], ['line\n', 'line_b\n'])
682
683
        except NotImplementedError:
683
684
            return
684
 
        vf.add_lines_with_ghosts('base', [], ['line\n', 'line_b\n'])
685
685
        vf.add_lines_with_ghosts('references_ghost',
686
686
                                 ['base', 'a_ghost'],
687
687
                                 ['line\n', 'line_b\n', 'line_c\n'])