339
335
# The push should have created target/a
340
336
self.failUnlessExists('target/a')
342
def test_push_use_existing_into_empty_bzrdir(self):
343
"""'bzr push --use-existing-dir' into a dir with an empty .bzr dir
346
tree = self.create_simple_tree()
347
self.build_tree(['target/', 'target/.bzr/'])
349
['Target directory ../target already contains a .bzr directory, '
350
'but it is not valid.'],
351
'push ../target --use-existing-dir', working_dir='tree')
353
338
def test_push_onto_repo(self):
354
339
"""We should be able to 'bzr push' into an existing bzrdir."""
355
340
tree = self.create_simple_tree()
772
757
self.set_config_push_strict('oFF')
773
758
self.assertPushFails(['--strict'])
774
759
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")