~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/plugins/weave_fmt/test_bzrdir.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:
27
27
from bzrlib import (
28
28
    branch,
29
29
    bzrdir,
 
30
    controldir,
30
31
    errors,
31
32
    repository,
32
33
    upgrade,
66
67
            self.assertTrue(ctrl_2 is ctrl_3)
67
68
        check_dir_components_use_same_lock(dir)
68
69
        # and if we open it normally.
69
 
        dir = bzrdir.BzrDir.open(self.get_url())
 
70
        dir = controldir.ControlDir.open(self.get_url())
70
71
        check_dir_components_use_same_lock(dir)
71
72
 
72
73
    def test_can_convert(self):
100
101
            self.assertTrue(ctrl_2 is ctrl_3)
101
102
        check_dir_components_use_same_lock(dir)
102
103
        # and if we open it normally.
103
 
        dir = bzrdir.BzrDir.open(self.get_url())
 
104
        dir = controldir.ControlDir.open(self.get_url())
104
105
        check_dir_components_use_same_lock(dir)
105
106
 
106
107
    def test_can_convert(self):
302
303
        # At this point, we have a format6 branch without checkout files.
303
304
        upgrade.upgrade('.', bzrdir.BzrDirMetaFormat1())
304
305
        # The upgrade should not have set up a working tree.
305
 
        control = bzrdir.BzrDir.open('.')
 
306
        control = controldir.ControlDir.open('.')
306
307
        self.assertFalse(control.has_workingtree())
307
308
        # We have covered the scope of this test, we may as well check that
308
309
        # upgrade has not eaten our data, even if it's a bit redundant with
319
320
        eq = self.assertEquals
320
321
        self.build_tree_contents(_upgrade1_template)
321
322
        upgrade.upgrade(u'.')
322
 
        control = bzrdir.BzrDir.open('.')
 
323
        control = controldir.ControlDir.open('.')
323
324
        b = control.open_branch()
324
325
        # tsk, peeking under the covers.
325
326
        self.assertIsInstance(
389
390
 
390
391
    def test_upgrade_makes_dir_weaves(self):
391
392
        self.build_tree_contents(_upgrade_dir_template)
392
 
        old_repodir = bzrdir.BzrDir.open_unsupported('.')
 
393
        old_repodir = controldir.ControlDir.open_unsupported('.')
393
394
        old_repo_format = old_repodir.open_repository()._format
394
395
        upgrade.upgrade('.')
395
396
        # this is the path to the literal file. As format changes
544
545
        self.build_tree(['master/', 'child/'])
545
546
        self.make_branch_and_tree('master')
546
547
        self.make_branch_and_tree('child',
547
 
                        format=bzrdir.format_registry.make_bzrdir('weave'))
 
548
                        format=controldir.format_registry.make_bzrdir('weave'))
548
549
        os.chdir('child')
549
550
 
550
551
    def test_bind_format_6_bzrdir(self):