55
55
def test_describe_repository_layout(self):
56
56
repository = self.make_repository('.', shared=True)
57
tree = bzrdir.BzrDir.create_branch_convenience('tree',
57
tree = controldir.ControlDir.create_branch_convenience('tree',
58
58
force_new_tree=True).bzrdir.open_workingtree()
59
59
self.assertEqual('Shared repository with trees',
60
60
info.describe_layout(tree.branch.repository))
90
90
# this ought to be easier...
91
91
branch.create_checkout('%s_co' % format,
92
92
lightweight=True).bzrdir.destroy_workingtree()
93
control = bzrdir.BzrDir.open('%s_co' % format)
93
control = controldir.ControlDir.open('%s_co' % format)
94
94
old_format = control._format.workingtree_format
96
96
control._format.workingtree_format = \
97
bzrdir.format_registry.make_bzrdir(format).workingtree_format
97
controldir.format_registry.make_bzrdir(format).workingtree_format
98
98
control.create_workingtree()
99
99
tree = workingtree.WorkingTree.open('%s_co' % format)
100
100
format_description = info.describe_format(tree.bzrdir,
124
124
repo, None, None))
126
126
def test_describe_tree_format(self):
127
for key in bzrdir.format_registry.keys():
128
if key in bzrdir.format_registry.aliases():
127
for key in controldir.format_registry.keys():
128
if key in controldir.format_registry.aliases():
130
130
self.assertTreeDescription(key)
132
132
def test_describe_checkout_format(self):
133
for key in bzrdir.format_registry.keys():
134
if key in bzrdir.format_registry.aliases():
133
for key in controldir.format_registry.keys():
134
if key in controldir.format_registry.aliases():
135
135
# Aliases will not describe correctly in the UI because the
136
136
# real format is found.
138
138
# legacy: weave does not support checkouts
139
139
if key == 'weave':
141
if bzrdir.format_registry.get_info(key).experimental:
141
if controldir.format_registry.get_info(key).experimental:
142
142
# We don't require that experimental formats support checkouts
143
143
# or describe correctly in the UI.
145
if bzrdir.format_registry.get_info(key).hidden:
145
if controldir.format_registry.get_info(key).hidden:
148
148
if key in ('pack-0.92',):
149
149
expected = 'pack-0.92'
150
150
elif key in ('knit', 'metaweave'):
151
if 'metaweave' in bzrdir.format_registry:
151
if 'metaweave' in controldir.format_registry:
152
152
expected = 'knit or metaweave'
154
154
expected = 'knit'
157
157
self.assertCheckoutDescription(key, expected)
159
159
def test_describe_branch_format(self):
160
for key in bzrdir.format_registry.keys():
161
if key in bzrdir.format_registry.aliases():
160
for key in controldir.format_registry.keys():
161
if key in controldir.format_registry.aliases():
163
if bzrdir.format_registry.get_info(key).hidden:
163
if controldir.format_registry.get_info(key).hidden:
166
166
if key in ('dirstate', 'knit'):
172
172
self.assertBranchDescription(key, expected)
174
174
def test_describe_repo_format(self):
175
for key in bzrdir.format_registry.keys():
176
if key in bzrdir.format_registry.aliases():
175
for key in controldir.format_registry.keys():
176
if key in controldir.format_registry.aliases():
178
if bzrdir.format_registry.get_info(key).hidden:
178
if controldir.format_registry.get_info(key).hidden:
181
181
if key in ('dirstate', 'knit', 'dirstate-tags'):
186
186
expected = '1.14-rich-root'
187
187
self.assertRepoDescription(key, expected)
189
format = bzrdir.format_registry.make_bzrdir('knit')
189
format = controldir.format_registry.make_bzrdir('knit')
190
190
format.set_branch_format(_mod_branch.BzrBranchFormat6())
191
191
tree = self.make_branch_and_tree('unknown', format=format)
192
192
self.assertEqual('unnamed', info.describe_format(tree.bzrdir,
272
272
info.gather_location_info(bound_branch.repository, bound_branch)
275
def test_gather_location_bound_in_repository(self):
276
repo = self.make_repository('repo', shared=True)
277
repo.set_make_working_trees(False)
278
branch = self.make_branch('branch')
279
bound_branch = controldir.ControlDir.create_branch_convenience(
281
bound_branch.bind(branch)
283
[('shared repository', bound_branch.repository.bzrdir.user_url),
284
('repository branch', bound_branch.bzrdir.user_url),
285
('bound to branch', branch.bzrdir.user_url)],
286
info.gather_location_info(bound_branch.repository, bound_branch)
275
289
def test_location_list(self):
276
290
if sys.platform == 'win32':
277
291
raise tests.TestSkipped('Windows-unfriendly test')