/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 breezy/tests/blackbox/test_push.py

  • Committer: Breezy landing bot
  • Author(s): Vincent Ladeuil
  • Date: 2019-03-06 14:58:32 UTC
  • mfrom: (7294.1.2 trunk)
  • Revision ID: breezy.the.bot@gmail.com-20190306145832-ghgjxu1recloriwh
Open trunk again as 3.1.0dev1

Merged from https://code.launchpad.net/~vila/brz/trunk/+merge/364041

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
from breezy import (
23
23
    branch,
24
24
    controldir,
 
25
    directory_service,
25
26
    errors,
26
27
    osutils,
27
28
    tests,
498
499
        self.assertPublished(branch_tree.last_revision(),
499
500
                             trunk_tree.branch.base)
500
501
 
 
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):
 
507
                if url == 'foo:':
 
508
                    return trunk_tree.branch.base
 
509
                return url
 
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)
 
520
 
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()