267
268
self.assertEqual([(b'A',), (b'C',)], sorted(
268
269
target_repo.revisions.keys()))
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)
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')
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)
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')
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)
270
340
def test_push_smart_with_default_stacking_url_path_segment(self):
271
341
# If the default stacked-on location is a path element then branches
272
342
# we push there over the smart server are stacked and their