~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2011-12-24 10:10:59 UTC
  • mfrom: (6405 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6407.
  • Revision ID: jelmer@samba.org-20111224101059-epghsc5y61hsgbl2
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
    )
34
34
from bzrlib.repofmt import knitrepo
35
35
from bzrlib.tests import (
36
 
    blackbox,
37
36
    http_server,
38
37
    scenarios,
39
38
    script,
40
39
    test_foreign,
41
 
    test_server,
42
40
    )
43
41
from bzrlib.tests.matchers import ContainsNoVfsCalls
44
42
from bzrlib.transport import memory
59
57
                           ['push', public_url],
60
58
                           working_dir='source')
61
59
 
 
60
    def test_push_suggests_parent_alias(self):
 
61
        """Push suggests using :parent if there is a known parent branch."""
 
62
        tree_a = self.make_branch_and_tree('a')
 
63
        tree_a.commit('this is a commit')
 
64
        tree_b = self.make_branch_and_tree('b')
 
65
 
 
66
        # If there is no parent location set, :parent isn't mentioned.
 
67
        out = self.run_bzr('push', working_dir='a', retcode=3)
 
68
        self.assertEquals(out,
 
69
                ('','bzr: ERROR: No push location known or specified.\n'))
 
70
 
 
71
        # If there is a parent location set, the error suggests :parent.
 
72
        tree_a.branch.set_parent(tree_b.branch.base)
 
73
        out = self.run_bzr('push', working_dir='a', retcode=3)
 
74
        self.assertEquals(out,
 
75
            ('','bzr: ERROR: No push location known or specified. '
 
76
                'To push to the parent branch '
 
77
                '(at %s), use \'bzr push :parent\'.\n' %
 
78
                urlutils.unescape_for_display(tree_b.branch.base, 'utf-8')))
 
79
 
62
80
    def test_push_remember(self):
63
81
        """Push changes from one branch to another and test push location."""
64
82
        transport = self.get_transport()
267
285
        # being too low. If rpc_count increases, more network roundtrips have
268
286
        # become necessary for this use case. Please do not adjust this number
269
287
        # upwards without agreement from bzr's network support maintainers.
270
 
        self.assertLength(13, self.hpss_calls)
 
288
        self.assertLength(14, self.hpss_calls)
271
289
        self.assertLength(1, self.hpss_connections)
272
290
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
273
291
        remote = branch.Branch.open('public')