~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_repository.py

Merge test_repository fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
428
428
        self.assertGetsDefaultInterRepository(dummy_a, dummy_b)
429
429
 
430
430
 
 
431
 
 
432
class TestRepositoryFormat1(knitrepo.RepositoryFormatKnit1):
 
433
 
 
434
    def get_format_string(self):
 
435
        return "Test Format 1"
 
436
 
 
437
 
 
438
class TestRepositoryFormat2(knitrepo.RepositoryFormatKnit1):
 
439
 
 
440
    def get_format_string(self):
 
441
        return "Test Format 2"
 
442
 
 
443
 
431
444
class TestRepositoryConverter(TestCaseWithTransport):
432
445
 
433
446
    def test_convert_empty(self):
434
 
        from bzrlib.plugins.weave_fmt.repository import RepositoryFormat7
435
 
        t = transport.get_transport(".")
 
447
        source_format = TestRepositoryFormat1()
 
448
        target_format = TestRepositoryFormat2()
 
449
        repository.format_registry.register(source_format)
 
450
        self.addCleanup(repository.format_registry.remove,
 
451
            source_format)
 
452
        repository.format_registry.register(target_format)
 
453
        self.addCleanup(repository.format_registry.remove,
 
454
            target_format)
 
455
        t = self.get_transport()
436
456
        t.mkdir('repository')
437
457
        repo_dir = bzrdir.BzrDirMetaFormat1().initialize('repository')
438
 
        repo = RepositoryFormat7().initialize(repo_dir)
439
 
        target_format = knitrepo.RepositoryFormatKnit1()
 
458
        repo = TestRepositoryFormat1().initialize(repo_dir)
440
459
        converter = repository.CopyConverter(target_format)
441
460
        pb = bzrlib.ui.ui_factory.nested_progress_bar()
442
461
        try: