~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bzrdir.py

  • Committer: Aaron Bentley
  • Date: 2008-09-20 20:35:02 UTC
  • mfrom: (3717 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3720.
  • Revision ID: aaron@aaronbentley.com-20080920203502-mdw6o6gtbalyo2bb
Merge with bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
486
486
        self.assertTrue(repo._format.supports_external_lookups)
487
487
        self.assertFalse(repo.supports_rich_root())
488
488
 
 
489
    def test_clone_on_transport_upgrades_format_if_stacked_on_specified(self):
 
490
        child_branch, new_child_transport = self.prepare_default_stacking(
 
491
            child_format='pack-0.92')
 
492
        new_child = child_branch.bzrdir.clone_on_transport(new_child_transport,
 
493
            stacked_on=child_branch.bzrdir.root_transport.base)
 
494
        self.assertEqual(child_branch.bzrdir.root_transport.base,
 
495
                         new_child.open_branch().get_stacked_on_url())
 
496
        repo = new_child.open_repository()
 
497
        self.assertTrue(repo._format.supports_external_lookups)
 
498
        self.assertFalse(repo.supports_rich_root())
 
499
 
489
500
    def test_sprout_upgrades_to_rich_root_format_if_needed(self):
490
501
        child_branch, new_child_transport = self.prepare_default_stacking(
491
502
            child_format='rich-root-pack')
492
 
        def do_sprout():
493
 
            try:
494
 
                return child_branch.bzrdir.sprout(new_child_transport.base,
495
 
                                                  stacked=True)
496
 
            except errors.IncompatibleRepositories:
497
 
                raise AssertionError(
498
 
                    'Rich root format should be sprout-compatible')
499
 
        self.expectFailure('Rich root format should be sprout-compatible',
500
 
                           do_sprout)
 
503
        new_child = child_branch.bzrdir.sprout(new_child_transport.base,
 
504
                                               stacked=True)
501
505
        repo = new_child.open_repository()
502
506
        self.assertTrue(repo._format.supports_external_lookups)
503
507
        self.assertTrue(repo.supports_rich_root())