~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Patch Queue Manager
  • Date: 2012-03-06 19:49:19 UTC
  • mfrom: (6472.2.6 use-bzr-controldir)
  • Revision ID: pqm@pqm.ubuntu.com-20120306194919-kt7mj6xmhifsgees
(jelmer) Use bzrlib.controldir for generic access to control directories,
 rather than bzrlib.bzrdir. (Jelmer Vernooij)

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):
2854
2854
        # stacking policy to honour; create a bzr dir with an unshared
2855
2855
        # repository (but not a branch - our code would be trying to escape
2856
2856
        # then!) to stop them, and permit it to be read.
2857
 
        # control = bzrdir.BzrDir.create(self.test_base_dir)
 
2857
        # control = controldir.ControlDir.create(self.test_base_dir)
2858
2858
        # control.create_repository()
2859
2859
        self.test_home_dir = self.test_base_dir + '/home'
2860
2860
        os.mkdir(self.test_home_dir)
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