~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bzrdir.py

  • Committer: Robert Collins
  • Date: 2010-04-08 04:34:03 UTC
  • mfrom: (5138 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5139.
  • Revision ID: robertc@robertcollins.net-20100408043403-56z0d07vdqrx7f3t
Update bugfix for 528114 to trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
    )
37
37
import bzrlib.branch
38
38
from bzrlib.errors import (NotBranchError,
 
39
                           NoColocatedBranchSupport,
39
40
                           UnknownFormatError,
40
41
                           UnsupportedFormatError,
41
42
                           )
50
51
    http_utils,
51
52
    )
52
53
from bzrlib.tests.test_http import TestWithTransport_pycurl
53
 
from bzrlib.transport import get_transport
 
54
from bzrlib.transport import (
 
55
    get_transport,
 
56
    memory,
 
57
    )
54
58
from bzrlib.transport.http._urllib import HttpTransport_urllib
55
 
from bzrlib.transport.memory import MemoryServer
56
59
from bzrlib.transport.nosmart import NoSmartTransportDecorator
57
60
from bzrlib.transport.readonly import ReadonlyTransportDecorator
58
61
from bzrlib.repofmt import knitrepo, weaverepo, pack_repo
204
207
        """See BzrDir.open_repository."""
205
208
        return SampleRepository(self)
206
209
 
207
 
    def create_branch(self):
 
210
    def create_branch(self, name=None):
208
211
        """See BzrDir.create_branch."""
 
212
        if name is not None:
 
213
            raise NoColocatedBranchSupport(self)
209
214
        return SampleBranch(self)
210
215
 
211
216
    def create_workingtree(self):
354
359
 
355
360
    def test_create_branch_convenience_root(self):
356
361
        """Creating a branch at the root of a fs should work."""
357
 
        self.vfs_transport_factory = MemoryServer
 
362
        self.vfs_transport_factory = memory.MemoryServer
358
363
        # outside a repo the default convenience output is a repo+branch_tree
359
364
        format = bzrdir.format_registry.make_bzrdir('knit')
360
365
        branch = bzrdir.BzrDir.create_branch_convenience(self.get_url(),
466
471
        # Make stackable source branch with an unstackable repo format.
467
472
        source_bzrdir = self.make_bzrdir('source')
468
473
        pack_repo.RepositoryFormatKnitPack1().initialize(source_bzrdir)
469
 
        source_branch = bzrlib.branch.BzrBranchFormat7().initialize(source_bzrdir)
 
474
        source_branch = bzrlib.branch.BzrBranchFormat7().initialize(
 
475
            source_bzrdir)
470
476
        # Make a directory with a default stacking policy
471
477
        parent_bzrdir = self.make_bzrdir('parent')
472
478
        stacked_on = self.make_branch('parent/stacked-on', format='pack-0.92')
565
571
 
566
572
    def setUp(self):
567
573
        super(ChrootedTests, self).setUp()
568
 
        if not self.vfs_transport_factory == MemoryServer:
 
574
        if not self.vfs_transport_factory == memory.MemoryServer:
569
575
            self.transport_readonly_server = http_server.HttpServer
570
576
 
571
577
    def local_branch_path(self, branch):
1049
1055
 
1050
1056
    def setUp(self):
1051
1057
        super(NonLocalTests, self).setUp()
1052
 
        self.vfs_transport_factory = MemoryServer
 
1058
        self.vfs_transport_factory = memory.MemoryServer
1053
1059
 
1054
1060
    def test_create_branch_convenience(self):
1055
1061
        # outside a repo the default convenience output is a repo+branch_tree