~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Robert Collins
  • Date: 2006-02-13 08:49:57 UTC
  • mto: (1534.5.2 bzr-dir)
  • mto: This revision was merged to the branch mainline in revision 1554.
  • Revision ID: robertc@robertcollins.net-20060213084957-29f8ae569f789cef
Creating or opening a branch will use the repository if the format supports that.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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.