30
31
"""A UI Factory which never captures its output.
35
"""See progress.ProgressBar.clear()."""
33
37
def note(self, fmt_string, *args, **kwargs):
34
38
"""See progress.ProgressBar.note()."""
35
39
print fmt_string % args
37
41
def progress_bar(self):
40
def update(self, message, count, total):
44
def update(self, message, count=None, total=None):
41
45
"""See progress.ProgressBar.update()."""
57
61
t.mkdir('format_5_branch')
58
62
bzrdir.BzrDirFormat5().initialize(self.get_url('format_5_branch'))
59
63
bzrdir.BzrDir.create_standalone_workingtree('current_format_branch')
64
d = bzrdir.BzrDir.create('metadir_weave_branch')
67
d.create_workingtree()
60
68
self.run_bzr('checkout',
61
69
self.get_url('current_format_branch'),
62
70
'current_format_checkout')
129
137
self.assertTrue(isinstance(
130
138
bzrdir.BzrDir.open(self.get_url('format_5_branch'))._format,
131
139
bzrdir.BzrDirMetaFormat1))
141
def test_upgrade_explicit_knit(self):
142
# users can force an upgrade to knit format from a metadir weave
144
url = get_transport(self.get_url('metadir_weave_branch')).base
145
# check --format takes effect
146
bzrdir.BzrDirFormat.set_default_format(bzrdir.BzrDirFormat5())
147
(out, err) = self.run_bzr_captured(
148
['upgrade', '--format=knit', url])
149
self.assertEqualDiff("""starting upgrade of %s
150
making backup of tree history
151
%s.bzr has been backed up to %s.bzr.backup
152
if conversion fails, you can move this directory back to .bzr
153
if it succeeds, you can remove this directory if you wish
154
starting repository conversion
157
""" % (url, url, url), out)
158
self.assertEqualDiff("", err)
159
converted_dir = bzrdir.BzrDir.open(self.get_url('metadir_weave_branch'))
160
self.assertTrue(isinstance(converted_dir._format,
161
bzrdir.BzrDirMetaFormat1))
162
self.assertTrue(isinstance(converted_dir.open_repository()._format,
163
repository.RepositoryFormatKnit1))