~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/bzrdir_implementations/test_bzrdir.py

  • Committer: Vincent Ladeuil
  • Date: 2009-06-17 16:37:11 UTC
  • mfrom: (4454 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4466.
  • Revision ID: v.ladeuil+lp@free.fr-20090617163711-iqubyv0tlqr8ayvl
Merge trunk@4454

Show diffs side-by-side

added added

removed removed

Lines of Context:
1246
1246
        self.assertTrue(repo.is_write_locked())
1247
1247
        repo.unlock()
1248
1248
 
 
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
 
1253
        # branch.
 
1254
        balloon = self.make_bzrdir('balloon')
 
1255
        if isinstance(balloon, bzrdir.BzrDirMetaFormat1):
 
1256
            stack_on = self.make_branch('stack-on', format='1.9')
 
1257
        else:
 
1258
            stack_on = self.make_branch('stack-on')
 
1259
        config = self.make_bzrdir('.').get_config()
 
1260
        try:
 
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)
 
1270
        if control is None:
 
1271
            # uninitialisable format
 
1272
            return
 
1273
        # There's one fallback repo, with a public location.
 
1274
        self.assertLength(1, repo._fallback_repositories)
 
1275
        fallback_repo = repo._fallback_repositories[0]
 
1276
        self.assertEqual(
 
1277
            stack_on.base, fallback_repo.bzrdir.root_transport.base)
 
1278
 
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)