~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_upgrade.py

  • Committer: Jelmer Vernooij
  • Date: 2010-08-02 14:09:16 UTC
  • mto: This revision was merged to the branch mainline in revision 5389.
  • Revision ID: jelmer@samba.org-20100802140916-btsth8yksukqcend
Fix tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
from bzrlib import (
22
22
    bzrdir,
23
 
    repository,
 
23
    controldir,
24
24
    transport,
25
25
    )
26
26
from bzrlib.tests import (
27
27
    features,
28
 
    TestCaseInTempDir,
29
28
    TestCaseWithTransport,
30
29
    )
31
30
from bzrlib.tests.test_sftp_transport import TestCaseWithSFTPServer
38
37
 
39
38
    def setUp(self):
40
39
        super(TestWithUpgradableBranches, self).setUp()
41
 
        self.addCleanup(bzrdir.BzrDirFormat._set_default_format,
42
 
                        bzrdir.BzrDirFormat.get_default_format())
 
40
        self.addCleanup(controldir.ControlDirFormat._set_default_format,
 
41
                        controldir.ControlDirFormat.get_default_format())
43
42
 
44
43
    def make_current_format_branch_and_checkout(self):
45
44
        current_tree = self.make_branch_and_tree('current_format_branch',
104
103
        self.make_format_5_branch()
105
104
        url = transport.get_transport(self.get_url('format_5_branch')).base
106
105
        # check --format takes effect
107
 
        bzrdir.BzrDirFormat._set_default_format(bzrdir.BzrDirFormat5())
 
106
        controldir.ControlDirFormat._set_default_format(bzrdir.BzrDirFormat5())
108
107
        backup_dir = 'backup.bzr.~1~'
109
108
        (out, err) = self.run_bzr(
110
109
            ['upgrade', '--format=metaweave', url])
128
127
        self.make_metadir_weave_branch()
129
128
        url = transport.get_transport(self.get_url('metadir_weave_branch')).base
130
129
        # check --format takes effect
131
 
        bzrdir.BzrDirFormat._set_default_format(bzrdir.BzrDirFormat5())
 
130
        controldir.ControlDirFormat._set_default_format(bzrdir.BzrDirFormat5())
132
131
        backup_dir = 'backup.bzr.~1~'
133
132
        (out, err) = self.run_bzr(
134
133
            ['upgrade', '--format=knit', url])
166
165
        self.make_format_5_branch()
167
166
        t = transport.get_transport(self.get_url('format_5_branch'))
168
167
        url = t.base
169
 
        bzrdir.BzrDirFormat._set_default_format(bzrdir.BzrDirFormat5())
 
168
        controldir.ControlDirFormat._set_default_format(bzrdir.BzrDirFormat5())
170
169
        backup_dir1 = 'backup.bzr.~1~'
171
170
        backup_dir2 = 'backup.bzr.~2~'
172
171
        # explicitly create backup_dir1. bzr should create the .~2~ directory