/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

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

Merge trunk, address review comments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import stat
20
20
 
21
21
from breezy import (
 
22
    bzr,
22
23
    controldir,
23
24
    lockable_files,
24
25
    ui,
130
131
 
131
132
    def test_upgrade_control_dir(self):
132
133
        old_format = OldBzrDirFormat()
133
 
        self.addCleanup(bzrdir.BzrProber.formats.remove,
 
134
        self.addCleanup(bzr.BzrProber.formats.remove,
134
135
            old_format.get_format_string())
135
 
        bzrdir.BzrProber.formats.register(old_format.get_format_string(),
 
136
        bzr.BzrProber.formats.register(old_format.get_format_string(),
136
137
            old_format)
137
138
        self.addCleanup(controldir.ControlDirFormat._set_default_format,
138
139
                        controldir.ControlDirFormat.get_default_format())
278
279
 
279
280
    def test_recommend_upgrade_wt4(self):
280
281
        # using a deprecated format gives a warning
281
 
        self.run_bzr('init --knit a')
 
282
        self.run_bzr('init --format=knit a')
282
283
        out, err = self.run_bzr('status a')
283
284
        self.assertContainsRe(err, 'brz upgrade .*[/\\\\]a')
284
285
 
286
287
        # we should only get a recommendation to upgrade when we're accessing
287
288
        # the actual workingtree, not when we only open a bzrdir that contains
288
289
        # an old workngtree
289
 
        self.run_bzr('init --knit a')
 
290
        self.run_bzr('init --format=knit a')
290
291
        out, err = self.run_bzr('revno a')
291
292
        if err.find('upgrade') > -1:
292
293
            self.fail("message shouldn't suggest upgrade:\n%s" % err)