33
33
def note(self, fmt_string, *args, **kwargs):
34
"""See progress.ProgressBae.note()."""
34
"""See progress.ProgressBar.note()."""
35
35
print fmt_string % args
37
37
def progress_bar(self):
40
def update(self, message, count, total):
41
"""See progress.ProgressBar.update()."""
41
44
class TestWithUpgradableBranches(TestCaseWithTransport):
103
106
def test_ugrade_branch_in_repo(self):
104
107
# upgrading a branch in a repo should warn about not upgrading the repo
110
def test_upgrade_explicit_metaformat(self):
111
# users can force an upgrade to metadir format.
112
url = get_transport(self.get_url('format_5_branch')).base
113
# check --format takes effect
114
bzrdir.BzrDirFormat.set_default_format(bzrdir.BzrDirFormat5())
115
(out, err) = self.run_bzr_captured(
116
['upgrade', '--format=metadir', url])
117
self.assertEqualDiff("""starting upgrade of %s
118
making backup of tree history
119
%s.bzr has been backed up to %s.bzr.backup
120
if conversion fails, you can move this directory back to .bzr
121
if it succeeds, you can remove this directory if you wish
122
starting upgrade from format 5 to 6
123
adding prefixes to weaves
124
adding prefixes to revision-store
125
starting upgrade from format 6 to metadir
127
""" % (url, url, url), out)
128
self.assertEqualDiff("", err)
129
self.assertTrue(isinstance(
130
bzrdir.BzrDir.open(self.get_url('format_5_branch'))._format,
131
bzrdir.BzrDirMetaFormat1))