~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bzrdir.py

  • Committer: Andrew Bennetts
  • Date: 2009-03-12 07:42:57 UTC
  • mto: This revision was merged to the branch mainline in revision 4129.
  • Revision ID: andrew.bennetts@canonical.com-20090312074257-vx7qxv8dy654g9kp
Fix bug when pushing stackable branch in unstackable repo to default-stacking target.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
from bzrlib.transport.memory import MemoryServer
60
60
from bzrlib.transport.nosmart import NoSmartTransportDecorator
61
61
from bzrlib.transport.readonly import ReadonlyTransportDecorator
62
 
from bzrlib.repofmt import knitrepo, weaverepo
 
62
from bzrlib.repofmt import knitrepo, weaverepo, pack_repo
63
63
 
64
64
 
65
65
class TestDefaultFormat(TestCase):
466
466
        self.assertEqual(child_branch.base,
467
467
                         new_child.open_branch().get_stacked_on_url())
468
468
 
 
469
    def test_default_stacking_with_stackable_branch_unstackable_repo(self):
 
470
        # Make stackable source branch with an unstackable repo format.
 
471
        source_bzrdir = self.make_bzrdir('source')
 
472
        pack_repo.RepositoryFormatKnitPack1().initialize(source_bzrdir)
 
473
        source_branch = bzrlib.branch.BzrBranchFormat7().initialize(source_bzrdir)
 
474
        # Make a directory with a default stacking policy
 
475
        parent_bzrdir = self.make_bzrdir('parent')
 
476
        stacked_on = self.make_branch('parent/stacked-on', format='pack-0.92')
 
477
        parent_bzrdir.get_config().set_default_stack_on(stacked_on.base)
 
478
        # Clone source into directory
 
479
        target = source_bzrdir.clone(self.get_url('parent/target'))
 
480
 
469
481
    def test_sprout_obeys_stacking_policy(self):
470
482
        child_branch, new_child_transport = self.prepare_default_stacking()
471
483
        new_child = child_branch.bzrdir.sprout(new_child_transport.base)