253
257
# upwards without agreement from bzr's network support maintainers.
254
258
self.assertLength(11, self.hpss_calls)
260
def test_push_smart_incremental_acceptance(self):
261
self.setup_smart_server_with_call_log()
262
t = self.make_branch_and_tree('from')
263
rev_id1 = t.commit(allow_pointless=True, message='first commit')
264
rev_id2 = t.commit(allow_pointless=True, message='second commit')
266
['push', self.get_url('to-one'), '-r1'], working_dir='from')
267
self.reset_smart_call_log()
268
self.run_bzr(['push', self.get_url('to-one')], working_dir='from')
269
# This figure represent the amount of work to perform this use case. It
270
# is entirely ok to reduce this number if a test fails due to rpc_count
271
# being too low. If rpc_count increases, more network roundtrips have
272
# become necessary for this use case. Please do not adjust this number
273
# upwards without agreement from bzr's network support maintainers.
274
self.assertLength(11, self.hpss_calls)
256
276
def test_push_smart_with_default_stacking_url_path_segment(self):
257
277
# If the default stacked-on location is a path element then branches
258
278
# we push there over the smart server are stacked and their
588
608
tests.TestCaseWithTransport.setUp(self)
589
609
self.memory_server = RedirectingMemoryServer()
590
self.memory_server.setUp()
591
self.addCleanup(self.memory_server.tearDown)
610
self.start_server(self.memory_server)
593
611
# Make the branch and tree that we'll be pushing.
594
612
t = self.make_branch_and_tree('tree')
595
613
self.build_tree(['tree/file'])
694
712
super(TestPushStrictWithChanges, self).setUp()
713
# Apply the changes defined in load_tests: one of _uncommitted_changes,
714
# _pending_merges or _out_of_sync_trees
695
715
getattr(self, self._changes_type)()
697
717
def _uncommitted_changes(self):
752
772
self.set_config_push_strict('oFF')
753
773
self.assertPushFails(['--strict'])
754
774
self.assertPushSucceeds([])
777
class TestPushForeign(blackbox.ExternalBase):
780
super(TestPushForeign, self).setUp()
781
test_foreign.register_dummy_foreign_for_test(self)
783
def make_dummy_builder(self, relpath):
784
builder = self.make_branch_builder(
785
relpath, format=test_foreign.DummyForeignVcsDirFormat())
786
builder.build_snapshot('revid', None,
787
[('add', ('', 'TREE_ROOT', 'directory', None)),
788
('add', ('foo', 'fooid', 'file', 'bar'))])
791
def test_no_roundtripping(self):
792
target_branch = self.make_dummy_builder('dp').get_branch()
793
source_tree = self.make_branch_and_tree("dc")
794
output, error = self.run_bzr("push -d dc dp", retcode=3)
795
self.assertEquals("", output)
796
self.assertEquals(error, "bzr: ERROR: It is not possible to losslessly"
797
" push to dummy. You may want to use dpush instead.\n")