~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Vincent Ladeuil
  • Date: 2012-03-08 18:30:33 UTC
  • mfrom: (6487 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6488.
  • Revision ID: v.ladeuil+lp@free.fr-20120308183033-bccqnbr1tpozs711
Merge bzr.dev resolving conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
import bzrlib
61
61
from bzrlib import (
62
62
    branchbuilder,
63
 
    bzrdir,
 
63
    controldir,
64
64
    chk_map,
65
65
    commands as _mod_commands,
66
66
    config,
1324
1324
        # hook into bzr dir opening. This leaves a small window of error for
1325
1325
        # transport tests, but they are well known, and we can improve on this
1326
1326
        # step.
1327
 
        bzrdir.BzrDir.hooks.install_named_hook("pre_open",
 
1327
        controldir.ControlDir.hooks.install_named_hook("pre_open",
1328
1328
            self._preopen_isolate_transport, "Check bzr directories are safe.")
1329
1329
 
1330
1330
    def _ndiff_strings(self, a, b):
2599
2599
        # http://pad.lv/825027).
2600
2600
        self.assertIs(None, os.environ.get('BZR_HOME', None))
2601
2601
        os.environ['BZR_HOME'] = root
2602
 
        wt = bzrdir.BzrDir.create_standalone_workingtree(root)
 
2602
        wt = controldir.ControlDir.create_standalone_workingtree(root)
2603
2603
        del os.environ['BZR_HOME']
2604
2604
        # Hack for speed: remember the raw bytes of the dirstate file so that
2605
2605
        # we don't need to re-open the wt to check it hasn't changed.
2654
2654
        self.test_home_dir = self.test_dir + "/MemoryTransportMissingHomeDir"
2655
2655
        self.permit_dir(self.test_dir)
2656
2656
 
2657
 
    def make_branch(self, relpath, format=None):
 
2657
    def make_branch(self, relpath, format=None, name=None):
2658
2658
        """Create a branch on the transport at relpath."""
2659
2659
        repo = self.make_repository(relpath, format=format)
2660
 
        return repo.bzrdir.create_branch(append_revisions_only=False)
 
2660
        return repo.bzrdir.create_branch(append_revisions_only=False,
 
2661
                                         name=name)
2661
2662
 
2662
2663
    def get_default_format(self):
2663
2664
        return 'default'
2675
2676
        if format is None:
2676
2677
            format = self.get_default_format()
2677
2678
        if isinstance(format, basestring):
2678
 
            format = bzrdir.format_registry.make_bzrdir(format)
 
2679
            format = controldir.format_registry.make_bzrdir(format)
2679
2680
        return format
2680
2681
 
2681
2682
    def make_bzrdir(self, relpath, format=None):
2849
2850
        # stacking policy to honour; create a bzr dir with an unshared
2850
2851
        # repository (but not a branch - our code would be trying to escape
2851
2852
        # then!) to stop them, and permit it to be read.
2852
 
        # control = bzrdir.BzrDir.create(self.test_base_dir)
 
2853
        # control = controldir.ControlDir.create(self.test_base_dir)
2853
2854
        # control.create_repository()
2854
2855
        self.test_home_dir = self.test_base_dir + '/home'
2855
2856
        os.mkdir(self.test_home_dir)
2995
2996
            if self.vfs_transport_factory is test_server.LocalURLServer:
2996
2997
                # the branch is colocated on disk, we cannot create a checkout.
2997
2998
                # hopefully callers will expect this.
2998
 
                local_controldir= bzrdir.BzrDir.open(self.get_vfs_only_url(relpath))
 
2999
                local_controldir = controldir.ControlDir.open(
 
3000
                    self.get_vfs_only_url(relpath))
2999
3001
                wt = local_controldir.create_workingtree()
3000
3002
                if wt.branch._format != b._format:
3001
3003
                    wt._branch = b