~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2012-02-20 12:19:29 UTC
  • mfrom: (6437.23.11 2.5)
  • mto: (6581.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 6582.
  • Revision ID: jelmer@samba.org-20120220121929-7ni2psvjoatm1yp4
Merge bzr/2.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
 
68
68
    def get_branch(self):
69
69
        if self.branch is None:
70
 
            self.branch = self.make_branch('')
 
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
 
            return 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
 
 
84
 
    def make_branch_builder(self, relpath, format=None):
85
 
        if format is None:
86
 
            format = self.branch_format._matchingbzrdir
87
 
        return super(TestCaseWithBranch, self).make_branch_builder(
88
 
            relpath, format=format)
89
 
 
90
 
    def make_repository(self, relpath, shared=False, format=None):
91
 
        made_control = self.make_bzrdir(relpath, format=format)
92
 
        return made_control.create_repository(shared=shared)
 
82
            raise tests.TestNotApplicable('Uninitializable branch format')
93
83
 
94
84
    def create_tree_with_merge(self):
95
85
        """Create a branch with a simple ancestry.