~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_push.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-03-20 05:55:49 UTC
  • mfrom: (4165.2.1 bug-345169)
  • Revision ID: pqm@pqm.ubuntu.com-20090320055549-rrh9zg82xpqdpbwz
(robertc) Fix bug 345169 by stacking when a policy requests it and
        the branch to stack on is stackable. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
392
392
        self.assertContainsRe(err,
393
393
                              'Using default stacking branch stack_on at .*')
394
394
 
 
395
    def test_push_stacks_with_default_stacking_if_target_is_stackable(self):
 
396
        self.make_branch('stack_on', format='1.6')
 
397
        self.make_bzrdir('.').get_config().set_default_stack_on('stack_on')
 
398
        self.make_branch('from', format='pack-0.92')
 
399
        out, err = self.run_bzr('push -d from to')
 
400
        branch = Branch.open('to')
 
401
        self.assertEqual('../stack_on', branch.get_stacked_on_url())
 
402
 
 
403
    def test_push_does_not_change_format_with_default_if_target_cannot(self):
 
404
        self.make_branch('stack_on', format='pack-0.92')
 
405
        self.make_bzrdir('.').get_config().set_default_stack_on('stack_on')
 
406
        self.make_branch('from', format='pack-0.92')
 
407
        out, err = self.run_bzr('push -d from to')
 
408
        branch = Branch.open('to')
 
409
        self.assertRaises(errors.UnstackableBranchFormat,
 
410
            branch.get_stacked_on_url)
 
411
 
395
412
    def test_push_doesnt_create_broken_branch(self):
396
413
        """Pushing a new standalone branch works even when there's a default
397
414
        stacking policy at the destination.