498
499
self.assertPublished(branch_tree.last_revision(),
499
500
trunk_tree.branch.base)
502
def test_push_new_branch_stacked_on(self):
503
"""Pushing a new branch with --stacked-on can use directory URLs."""
504
trunk_tree, branch_tree = self.create_trunk_and_feature_branch()
505
class FooDirectory(object):
506
def look_up(self, name, url, purpose=None):
508
return trunk_tree.branch.base
510
directory_service.directories.register('foo:', FooDirectory, 'Foo directory')
511
self.addCleanup(directory_service.directories.remove, 'foo:')
512
# we publish branch_tree with a reference to the mainline.
513
out, err = self.run_bzr(['push', '--stacked-on', 'foo:',
514
self.get_url('published')], working_dir='branch')
515
self.assertEqual('', out)
516
self.assertEqual('Created new stacked branch referring to %s.\n' %
517
trunk_tree.branch.base, err)
518
self.assertPublished(branch_tree.last_revision(),
519
trunk_tree.branch.base)
501
521
def test_push_new_branch_stacked_uses_parent_when_no_public_url(self):
502
522
"""When the parent has no public url the parent is used as-is."""
503
523
trunk_tree, branch_tree = self.create_trunk_and_feature_branch()