392
392
self.assertContainsRe(err,
393
393
'Using default stacking branch stack_on at .*')
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())
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)
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.