/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: Robert Collins
  • Date: 2009-03-19 04:08:21 UTC
  • mto: This revision was merged to the branch mainline in revision 4174.
  • Revision ID: robertc@robertcollins.net-20090319040821-c1id0avkcpjvr0hw
Fix bzr failing to stack when a server requests it and the branch it is pushing from cannot stack but the branch it should stack on can.

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.