998
998
repo_name = old_fmt.repository_format.network_name()
999
999
# Should end up with a 1.9 format (stackable)
1000
1000
repo, control = self.assertInitializeEx(t, need_meta=True,
1001
repo_format_name=repo_name, stacked_on='../trunk', stack_on_pwd=t.base)
1001
repo_format_name=repo_name, stacked_on='../trunk',
1002
stack_on_pwd=t.base)
1002
1003
if control is None:
1003
1004
# uninitialisable format
1282
1283
self.assertIsInstance(opened_tree, made_tree.__class__)
1283
1284
self.assertIsInstance(opened_tree._format, made_tree._format.__class__)
1286
def test_get_selected_branch(self):
1287
# The segment parameters are accessible from the root transport
1288
# if a URL with segment parameters is opened.
1289
if not self.bzrdir_format.is_supported():
1290
# unsupported formats are not loopback testable
1291
# because the default open will not open them and
1292
# they may not be initializable.
1294
t = self.get_transport()
1296
made_control = self.bzrdir_format.initialize(t.base)
1297
except (errors.NotLocalUrl, errors.UnsupportedOperation):
1298
raise TestSkipped("Can't initialize %r on transport %r"
1299
% (self.bzrdir_format, t))
1300
dir = bzrdir.BzrDir.open(t.base+",branch=foo")
1301
self.assertEquals({"branch": "foo"},
1302
dir.user_transport.get_segment_parameters())
1303
self.assertEquals("foo", dir._get_selected_branch())
1305
def test_get_selected_branch_none_selected(self):
1306
# _get_selected_branch defaults to None
1307
if not self.bzrdir_format.is_supported():
1308
# unsupported formats are not loopback testable
1309
# because the default open will not open them and
1310
# they may not be initializable.
1312
t = self.get_transport()
1314
made_control = self.bzrdir_format.initialize(t.base)
1315
except (errors.NotLocalUrl, errors.UnsupportedOperation):
1316
raise TestSkipped("Can't initialize %r on transport %r"
1317
% (self.bzrdir_format, t))
1318
dir = bzrdir.BzrDir.open(t.base)
1319
self.assertIs(None, dir._get_selected_branch())
1285
1321
def test_root_transport(self):
1286
1322
dir = self.make_bzrdir('.')
1287
1323
self.assertEqual(dir.root_transport.base,