~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/branch_implementations/test_branch.py

Merge repository so I dont trample on myself.

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
        except errors.UninitializableFormat:
67
67
            raise TestSkipped('Uninitializable branch format')
68
68
 
69
 
    def make_repository(self, relpath):
 
69
    def make_repository(self, relpath, shared=False):
70
70
        try:
71
71
            url = self.get_url(relpath)
72
72
            segments = url.split('/')
78
78
                except FileExists:
79
79
                    pass
80
80
            made_control = self.bzrdir_format.initialize(url)
81
 
            return made_control.create_repository()
 
81
            return made_control.create_repository(shared=shared)
82
82
        except UninitializableFormat:
83
83
            raise TestSkipped("Format %s is not initializable.")
84
84
 
320
320
        self.assertEqual(committed.properties["branch-nick"], 
321
321
                         "My happy branch")
322
322
 
 
323
    def test_create_open_branch_uses_repository(self):
 
324
        try:
 
325
            repo = self.make_repository('.', shared=True)
 
326
        except errors.IncompatibleFormat:
 
327
            return
 
328
        repo.bzrdir.root_transport.mkdir('child')
 
329
        child_dir = self.bzrdir_format.initialize('child')
 
330
        try:
 
331
            child_branch = self.branch_format.initialize(child_dir)
 
332
        except errors.UninitializableFormat:
 
333
            # branch references are not default init'able.
 
334
            return
 
335
        self.assertEqual(repo.bzrdir.root_transport.base,
 
336
                         child_branch.repository.bzrdir.root_transport.base)
 
337
        child_branch = bzrlib.branch.Branch.open(self.get_url('child'))
 
338
        self.assertEqual(repo.bzrdir.root_transport.base,
 
339
                         child_branch.repository.bzrdir.root_transport.base)
 
340
 
323
341
 
324
342
class ChrootedTests(TestCaseWithBranch):
325
343
    """A support class that provides readonly urls outside the local namespace.