/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: Jelmer Vernooij
  • Date: 2020-06-19 21:26:53 UTC
  • mfrom: (7490.40.19 work)
  • mto: This revision was merged to the branch mainline in revision 7516.
  • Revision ID: jelmer@jelmer.uk-20200619212653-7j6rgywzczhc8cmj
Merge lp:brz/3.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
    script,
42
42
    test_foreign,
43
43
    )
44
 
from breezy.bzr.tests.matchers import ContainsNoVfsCalls
45
44
from breezy.transport import memory
46
45
 
47
46
 
268
267
        self.assertEqual([(b'A',), (b'C',)], sorted(
269
268
            target_repo.revisions.keys()))
270
269
 
271
 
    def test_push_smart_non_stacked_streaming_acceptance(self):
272
 
        self.setup_smart_server_with_call_log()
273
 
        t = self.make_branch_and_tree('from')
274
 
        t.commit(allow_pointless=True, message='first commit')
275
 
        self.reset_smart_call_log()
276
 
        self.run_bzr(['push', self.get_url('to-one')], working_dir='from')
277
 
        # This figure represent the amount of work to perform this use case. It
278
 
        # is entirely ok to reduce this number if a test fails due to rpc_count
279
 
        # being too low. If rpc_count increases, more network roundtrips have
280
 
        # become necessary for this use case. Please do not adjust this number
281
 
        # upwards without agreement from bzr's network support maintainers.
282
 
        self.assertLength(9, self.hpss_calls)
283
 
        self.assertLength(1, self.hpss_connections)
284
 
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
285
 
 
286
 
    def test_push_smart_stacked_streaming_acceptance(self):
287
 
        self.setup_smart_server_with_call_log()
288
 
        parent = self.make_branch_and_tree('parent', format='1.9')
289
 
        parent.commit(message='first commit')
290
 
        local = parent.controldir.sprout('local').open_workingtree()
291
 
        local.commit(message='local commit')
292
 
        self.reset_smart_call_log()
293
 
        self.run_bzr(['push', '--stacked', '--stacked-on', '../parent',
294
 
                      self.get_url('public')], working_dir='local')
295
 
        # This figure represent the amount of work to perform this use case. It
296
 
        # is entirely ok to reduce this number if a test fails due to rpc_count
297
 
        # being too low. If rpc_count increases, more network roundtrips have
298
 
        # become necessary for this use case. Please do not adjust this number
299
 
        # upwards without agreement from bzr's network support maintainers.
300
 
        self.assertLength(15, self.hpss_calls)
301
 
        self.assertLength(1, self.hpss_connections)
302
 
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
303
 
        remote = branch.Branch.open('public')
304
 
        self.assertEndsWith(remote.get_stacked_on_url(), '/parent')
305
 
 
306
 
    def test_push_smart_tags_streaming_acceptance(self):
307
 
        self.setup_smart_server_with_call_log()
308
 
        t = self.make_branch_and_tree('from')
309
 
        rev_id = t.commit(allow_pointless=True, message='first commit')
310
 
        t.branch.tags.set_tag('new-tag', rev_id)
311
 
        self.reset_smart_call_log()
312
 
        self.run_bzr(['push', self.get_url('to-one')], working_dir='from')
313
 
        # This figure represent the amount of work to perform this use case. It
314
 
        # is entirely ok to reduce this number if a test fails due to rpc_count
315
 
        # being too low. If rpc_count increases, more network roundtrips have
316
 
        # become necessary for this use case. Please do not adjust this number
317
 
        # upwards without agreement from bzr's network support maintainers.
318
 
        self.assertLength(11, self.hpss_calls)
319
 
        self.assertLength(1, self.hpss_connections)
320
 
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
321
 
 
322
 
    def test_push_smart_incremental_acceptance(self):
323
 
        self.setup_smart_server_with_call_log()
324
 
        t = self.make_branch_and_tree('from')
325
 
        rev_id1 = t.commit(allow_pointless=True, message='first commit')
326
 
        rev_id2 = t.commit(allow_pointless=True, message='second commit')
327
 
        self.run_bzr(
328
 
            ['push', self.get_url('to-one'), '-r1'], working_dir='from')
329
 
        self.reset_smart_call_log()
330
 
        self.run_bzr(['push', self.get_url('to-one')], working_dir='from')
331
 
        # This figure represent the amount of work to perform this use case. It
332
 
        # is entirely ok to reduce this number if a test fails due to rpc_count
333
 
        # being too low. If rpc_count increases, more network roundtrips have
334
 
        # become necessary for this use case. Please do not adjust this number
335
 
        # upwards without agreement from bzr's network support maintainers.
336
 
        self.assertLength(11, self.hpss_calls)
337
 
        self.assertLength(1, self.hpss_connections)
338
 
        self.assertThat(self.hpss_calls, ContainsNoVfsCalls)
339
 
 
340
270
    def test_push_smart_with_default_stacking_url_path_segment(self):
341
271
        # If the default stacked-on location is a path element then branches
342
272
        # we push there over the smart server are stacked and their