~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bzrdir.py

  • Committer: Vincent Ladeuil
  • Date: 2010-02-10 16:41:09 UTC
  • mto: (5029.2.1 integration2)
  • mto: This revision was merged to the branch mainline in revision 5031.
  • Revision ID: v.ladeuil+lp@free.fr-20100210164109-q5wluu91am3vsf6d
Use a set() for conflicts_related to stay O(1).

Show diffs side-by-side

added added

removed removed

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