~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_branch/__init__.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
            self.branch = self.make_branch('abranch')
71
71
        return self.branch
72
72
 
 
73
    def get_default_format(self):
 
74
        format = self.bzrdir_format
 
75
        self.assertEquals(format.get_branch_format(), self.branch_format)
 
76
        return format
 
77
 
73
78
    def make_branch(self, relpath, format=None):
74
 
        if format is not None:
75
 
            return TestCaseWithControlDir.make_branch(self, relpath, format)
76
 
        repo = self.make_repository(relpath)
77
 
        # fixme RBC 20060210 this isnt necessarily a fixable thing,
78
 
        # Skipped is the wrong exception to raise.
79
79
        try:
80
 
            branch = self.branch_format.initialize(repo.bzrdir)
 
80
            return super(TestCaseWithBranch, self).make_branch(relpath, format)
81
81
        except errors.UninitializableFormat:
82
 
            raise tests.TestSkipped('Uninitializable branch format')
83
 
        if (branch._format.supports_set_append_revisions_only() and
84
 
            branch.get_append_revisions_only()):
85
 
            branch.set_append_revisions_only(False)
86
 
        return branch
87
 
 
88
 
    def make_branch_builder(self, relpath, format=None):
89
 
        if format is None:
90
 
            format = self.branch_format._matchingbzrdir
91
 
        return super(TestCaseWithBranch, self).make_branch_builder(
92
 
            relpath, format=format)
93
 
 
94
 
    def make_repository(self, relpath, shared=None, format=None):
95
 
        made_control = self.make_bzrdir(relpath, format=format)
96
 
        return made_control.create_repository(shared=shared)
 
82
            raise tests.TestNotApplicable('Uninitializable branch format')
97
83
 
98
84
    def create_tree_with_merge(self):
99
85
        """Create a branch with a simple ancestry.