~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Patch Queue Manager
  • Date: 2011-10-14 16:54:26 UTC
  • mfrom: (6216.1.1 remove-this-file)
  • Revision ID: pqm@pqm.ubuntu.com-20111014165426-tjix4e6idryf1r2z
(jelmer) Remove an accidentally committed .THIS file. (Jelmer Vernooij)

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,
36
37
    http_server,
37
38
    scenarios,
38
39
    script,
39
40
    test_foreign,
 
41
    test_server,
40
42
    )
41
 
from bzrlib.tests.matchers import ContainsNoVfsCalls
42
43
from bzrlib.transport import memory
43
44
 
44
45
 
57
58
                           ['push', public_url],
58
59
                           working_dir='source')
59
60
 
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
 
 
80
61
    def test_push_remember(self):
81
62
        """Push changes from one branch to another and test push location."""
82
63
        transport = self.get_transport()
268
249
        # become necessary for this use case. Please do not adjust this number
269
250
        # upwards without agreement from bzr's network support maintainers.
270
251
        self.assertLength(9, self.hpss_calls)
271
 
        self.assertLength(1, self.hpss_connections)
272
 
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
273
252
 
274
253
    def test_push_smart_stacked_streaming_acceptance(self):
275
254
        self.setup_smart_server_with_call_log()
285
264
        # being too low. If rpc_count increases, more network roundtrips have
286
265
        # become necessary for this use case. Please do not adjust this number
287
266
        # upwards without agreement from bzr's network support maintainers.
288
 
        self.assertLength(14, self.hpss_calls)
289
 
        self.assertLength(1, self.hpss_connections)
290
 
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
 
267
        self.assertLength(13, self.hpss_calls)
291
268
        remote = branch.Branch.open('public')
292
269
        self.assertEndsWith(remote.get_stacked_on_url(), '/parent')
293
270
 
304
281
        # become necessary for this use case. Please do not adjust this number
305
282
        # upwards without agreement from bzr's network support maintainers.
306
283
        self.assertLength(11, self.hpss_calls)
307
 
        self.assertLength(1, self.hpss_connections)
308
 
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
309
284
 
310
285
    def test_push_smart_incremental_acceptance(self):
311
286
        self.setup_smart_server_with_call_log()
322
297
        # become necessary for this use case. Please do not adjust this number
323
298
        # upwards without agreement from bzr's network support maintainers.
324
299
        self.assertLength(11, self.hpss_calls)
325
 
        self.assertLength(1, self.hpss_connections)
326
 
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
327
300
 
328
301
    def test_push_smart_with_default_stacking_url_path_segment(self):
329
302
        # If the default stacked-on location is a path element then branches