~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Jelmer Vernooij
  • Date: 2012-02-23 19:45:15 UTC
  • mto: This revision was merged to the branch mainline in revision 6486.
  • Revision ID: jelmer@samba.org-20120223194515-1ctgfzj362m0tu0k
Use bzrdir.controldir for generic access to control directories.

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,
1328
1328
        # hook into bzr dir opening. This leaves a small window of error for
1329
1329
        # transport tests, but they are well known, and we can improve on this
1330
1330
        # step.
1331
 
        bzrdir.BzrDir.hooks.install_named_hook("pre_open",
 
1331
        controldir.ControlDir.hooks.install_named_hook("pre_open",
1332
1332
            self._preopen_isolate_transport, "Check bzr directories are safe.")
1333
1333
 
1334
1334
    def _ndiff_strings(self, a, b):
2603
2603
        # http://pad.lv/825027).
2604
2604
        self.assertIs(None, os.environ.get('BZR_HOME', None))
2605
2605
        os.environ['BZR_HOME'] = root
2606
 
        wt = bzrdir.BzrDir.create_standalone_workingtree(root)
 
2606
        wt = controldir.ControlDir.create_standalone_workingtree(root)
2607
2607
        del os.environ['BZR_HOME']
2608
2608
        # Hack for speed: remember the raw bytes of the dirstate file so that
2609
2609
        # we don't need to re-open the wt to check it hasn't changed.
2680
2680
        if format is None:
2681
2681
            format = self.get_default_format()
2682
2682
        if isinstance(format, basestring):
2683
 
            format = bzrdir.format_registry.make_bzrdir(format)
 
2683
            format = controldir.format_registry.make_bzrdir(format)
2684
2684
        return format
2685
2685
 
2686
2686
    def make_bzrdir(self, relpath, format=None):
3000
3000
            if self.vfs_transport_factory is test_server.LocalURLServer:
3001
3001
                # the branch is colocated on disk, we cannot create a checkout.
3002
3002
                # hopefully callers will expect this.
3003
 
                local_controldir= bzrdir.BzrDir.open(self.get_vfs_only_url(relpath))
 
3003
                local_controldir = controldir.ControlDir.open(
 
3004
                    self.get_vfs_only_url(relpath))
3004
3005
                wt = local_controldir.create_workingtree()
3005
3006
                if wt.branch._format != b._format:
3006
3007
                    wt._branch = b