~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_repository.py

  • Committer: John Arbash Meinel
  • Date: 2009-07-29 21:35:05 UTC
  • mfrom: (4576 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4577.
  • Revision ID: john@arbash-meinel.com-20090729213505-tkqsvy1zfpocu75w
Merge bzr.dev 4576 in prep for NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
486
486
    _serializer = None
487
487
 
488
488
    def supports_rich_root(self):
489
 
        if self._format is not None:
490
 
            return self._format.rich_root_data
491
489
        return False
492
490
 
493
491
    def get_graph(self):
544
542
        # pair that it returns true on for the is_compatible static method
545
543
        # check
546
544
        dummy_a = DummyRepository()
547
 
        dummy_a._format = RepositoryFormat()
548
545
        dummy_b = DummyRepository()
549
 
        dummy_b._format = RepositoryFormat()
550
546
        repo = self.make_repository('.')
551
547
        # hack dummies to look like repo somewhat.
552
548
        dummy_a._serializer = repo._serializer
553
 
        dummy_a._format.supports_tree_reference = repo._format.supports_tree_reference
554
 
        dummy_a._format.rich_root_data = repo._format.rich_root_data
555
549
        dummy_b._serializer = repo._serializer
556
 
        dummy_b._format.supports_tree_reference = repo._format.supports_tree_reference
557
 
        dummy_b._format.rich_root_data = repo._format.rich_root_data
558
550
        repository.InterRepository.register_optimiser(InterDummy)
559
551
        try:
560
552
            # we should get the default for something InterDummy returns False
1016
1008
        """
1017
1009
        broken_repo = self.make_broken_repository()
1018
1010
        empty_repo = self.make_repository('empty-repo')
1019
 
        try:
1020
 
            empty_repo.fetch(broken_repo)
1021
 
        except (errors.RevisionNotPresent, errors.BzrCheckError):
1022
 
            # Test successful: compression parent not being copied leads to
1023
 
            # error.
1024
 
            return
1025
 
        empty_repo.lock_read()
1026
 
        self.addCleanup(empty_repo.unlock)
1027
 
        text = empty_repo.texts.get_record_stream(
1028
 
            [('file2-id', 'rev3')], 'topological', True).next()
1029
 
        self.assertEqual('line\n', text.get_bytes_as('fulltext'))
 
1011
        # See bug https://bugs.launchpad.net/bzr/+bug/389141 for information
 
1012
        # about why this was turned into expectFailure
 
1013
        self.expectFailure('new Stream fetch fills in missing compression'
 
1014
           ' parents (bug #389141)',
 
1015
           self.assertRaises, (errors.RevisionNotPresent, errors.BzrCheckError),
 
1016
                              empty_repo.fetch, broken_repo)
 
1017
        self.assertRaises((errors.RevisionNotPresent, errors.BzrCheckError),
 
1018
                          empty_repo.fetch, broken_repo)
1030
1019
 
1031
1020
 
1032
1021
class TestRepositoryPackCollection(TestCaseWithTransport):
1041
1030
 
1042
1031
    def make_packs_and_alt_repo(self, write_lock=False):
1043
1032
        """Create a pack repo with 3 packs, and access it via a second repo."""
1044
 
        tree = self.make_branch_and_tree('.', format=self.get_format())
 
1033
        tree = self.make_branch_and_tree('.')
1045
1034
        tree.lock_write()
1046
1035
        self.addCleanup(tree.unlock)
1047
1036
        rev1 = tree.commit('one')
1357
1346
    """Tests for the packs repository Packer class."""
1358
1347
 
1359
1348
    def test_pack_optimizes_pack_order(self):
1360
 
        builder = self.make_branch_builder('.', format="1.9")
 
1349
        builder = self.make_branch_builder('.')
1361
1350
        builder.start_series()
1362
1351
        builder.build_snapshot('A', None, [
1363
1352
            ('add', ('', 'root-id', 'directory', None)),