~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_repository.py

  • Committer: INADA Naoki
  • Date: 2011-05-17 00:45:09 UTC
  • mfrom: (5875 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5891.
  • Revision ID: songofacandy@gmail.com-20110517004509-q58negjbdjh7t6u1
mergeĀ fromĀ lp:bzr

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
    revision as _mod_revision,
53
53
    upgrade,
54
54
    versionedfile,
 
55
    vf_repository,
55
56
    workingtree,
56
57
    )
57
58
from bzrlib.repofmt import (
378
379
        # classes do not barf inappropriately when a surprising repository type
379
380
        # is handed to them.
380
381
        dummy_a = DummyRepository()
 
382
        dummy_a._format = RepositoryFormat()
 
383
        dummy_a._format.supports_full_versioned_files = True
381
384
        dummy_b = DummyRepository()
 
385
        dummy_b._format = RepositoryFormat()
 
386
        dummy_b._format.supports_full_versioned_files = True
382
387
        self.assertGetsDefaultInterRepository(dummy_a, dummy_b)
383
388
 
384
389
    def assertGetsDefaultInterRepository(self, repo_a, repo_b):
388
393
        no actual sane default in the presence of incompatible data models.
389
394
        """
390
395
        inter_repo = repository.InterRepository.get(repo_a, repo_b)
391
 
        self.assertEqual(repository.InterSameDataRepository,
 
396
        self.assertEqual(vf_repository.InterSameDataRepository,
392
397
                         inter_repo.__class__)
393
398
        self.assertEqual(repo_a, inter_repo.source)
394
399
        self.assertEqual(repo_b, inter_repo.target)
408
413
        dummy_a._serializer = repo._serializer
409
414
        dummy_a._format.supports_tree_reference = repo._format.supports_tree_reference
410
415
        dummy_a._format.rich_root_data = repo._format.rich_root_data
 
416
        dummy_a._format.supports_full_versioned_files = repo._format.supports_full_versioned_files
411
417
        dummy_b._serializer = repo._serializer
412
418
        dummy_b._format.supports_tree_reference = repo._format.supports_tree_reference
413
419
        dummy_b._format.rich_root_data = repo._format.rich_root_data
 
420
        dummy_b._format.supports_full_versioned_files = repo._format.supports_full_versioned_files
414
421
        repository.InterRepository.register_optimiser(InterDummy)
415
422
        try:
416
423
            # we should get the default for something InterDummy returns False
666
673
        target = self.make_repository('target', format='rich-root-pack')
667
674
        stream = source._get_source(target._format)
668
675
        # We don't want the child GroupCHKStreamSource
669
 
        self.assertIs(type(stream), repository.StreamSource)
 
676
        self.assertIs(type(stream), vf_repository.StreamSource)
670
677
 
671
678
    def test_get_stream_for_missing_keys_includes_all_chk_refs(self):
672
679
        source_builder = self.make_branch_builder('source',
781
788
        source = self.make_repository('source', format='pack-0.92')
782
789
        target = self.make_repository('target', format='1.9')
783
790
        stream = source._get_source(target._format)
784
 
        self.assertIs(type(stream), repository.StreamSource)
 
791
        self.assertIs(type(stream), vf_repository.StreamSource)
785
792
 
786
793
    def test_stream_source_to_non_exact_rich_root(self):
787
794
        source = self.make_repository('source', format='1.9')
788
795
        target = self.make_repository('target', format='1.9-rich-root')
789
796
        stream = source._get_source(target._format)
790
 
        self.assertIs(type(stream), repository.StreamSource)
 
797
        self.assertIs(type(stream), vf_repository.StreamSource)
791
798
 
792
799
    def test_source_to_remote_non_exact_pack_19(self):
793
800
        trans = self.make_smart_server('target')
796
803
        target = self.make_repository('target', format='1.6')
797
804
        target = repository.Repository.open(trans.base)
798
805
        stream_source = source._get_source(target._format)
799
 
        self.assertIs(type(stream_source), repository.StreamSource)
 
806
        self.assertIs(type(stream_source), vf_repository.StreamSource)
800
807
 
801
808
    def test_stream_source_to_knit(self):
802
809
        source = self.make_repository('source', format='pack-0.92')
803
810
        target = self.make_repository('target', format='dirstate')
804
811
        stream = source._get_source(target._format)
805
 
        self.assertIs(type(stream), repository.StreamSource)
 
812
        self.assertIs(type(stream), vf_repository.StreamSource)
806
813
 
807
814
 
808
815
class TestDevelopment6FindParentIdsOfRevisions(TestCaseWithTransport):