1246
1246
self.assertTrue(repo.is_write_locked())
1249
def test_format_initialize_on_transport_ex_default_stack_on(self):
1250
# When initialize_on_transport_ex uses a stacked-on branch because of
1251
# a stacking policy on the target, the location of the fallback
1252
# repository is the same as the external location of the stacked-on
1254
balloon = self.make_bzrdir('balloon')
1255
if isinstance(balloon, bzrdir.BzrDirMetaFormat1):
1256
stack_on = self.make_branch('stack-on', format='1.9')
1258
stack_on = self.make_branch('stack-on')
1259
config = self.make_bzrdir('.').get_config()
1261
config.set_default_stack_on('stack-on')
1262
except errors.BzrError:
1263
raise TestNotApplicable('Only relevant for stackable formats.')
1264
# Initialize a bzrdir subject to the policy.
1265
t = self.get_transport('stacked')
1266
repo_fmt = bzrdir.format_registry.make_bzrdir('1.9')
1267
repo_name = repo_fmt.repository_format.network_name()
1268
repo, control = self.assertInitializeEx(
1269
t, need_meta=True, repo_format_name=repo_name, stacked_on=None)
1271
# uninitialisable format
1273
# There's one fallback repo, with a public location.
1274
self.assertLength(1, repo._fallback_repositories)
1275
fallback_repo = repo._fallback_repositories[0]
1277
stack_on.base, fallback_repo.bzrdir.root_transport.base)
1249
1279
def test_format_initialize_on_transport_ex_repo_fmt_name_None(self):
1250
1280
t = self.get_transport('dir')
1251
1281
repo, control = self.assertInitializeEx(t)