summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2011-04-28 14:28:28 +0200
committerJelmer Vernooij <jelmer@samba.org>2011-04-28 14:28:28 +0200
commitcc60a7e656a16fe8a3994e5046858307bb236340 (patch)
tree577d2ebe920536f5f3c459390ddf4c673ab4f9b3
parent240383e171768e53a1b27144a9e054ced4d8da10 (diff)
parent65baca4207268205e512f4ffde2413dd18b11fb2 (diff)
downloadbzr-fastimport-cc60a7e656a16fe8a3994e5046858307bb236340.tar.gz
Fix regression in command implementation of 'bzr fast-import' introduced in r310 and add a blackbox test to prevent future regressions.
-rw-r--r--cmds.py5
-rw-r--r--tests/test_commands.py14
2 files changed, 17 insertions, 2 deletions
diff --git a/cmds.py b/cmds.py
index eeb4a7f..0902194 100644
--- a/cmds.py
+++ b/cmds.py
@@ -309,8 +309,9 @@ class cmd_fast_import(Command):
'import-marks': import_marks,
'export-marks': export_marks,
}
- return _run(source, generic_processor.GenericProcessor, control=control,
- params=params, verbose=verbose, user_map=user_map)
+ return _run(source, generic_processor.GenericProcessor,
+ bzrdir=control, params=params, verbose=verbose,
+ user_map=user_map)
def _generate_info(self, source):
from cStringIO import StringIO
diff --git a/tests/test_commands.py b/tests/test_commands.py
index 67c47d0..c817a8a 100644
--- a/tests/test_commands.py
+++ b/tests/test_commands.py
@@ -121,3 +121,17 @@ Head analysis:
\t[':1']\trefs/heads/master
Merges:
""")
+
+
+class TestFastImport(ExternalBase):
+
+ def test_empty(self):
+ self.build_tree_contents([('empty.fi', "")])
+ self.make_branch_and_tree("br")
+ self.assertEquals("", self.run_bzr("fast-import empty.fi br")[0])
+
+ def test_file(self):
+ tree = self.make_branch_and_tree("br")
+ self.build_tree_contents([('file.fi', simple_fast_import_stream)])
+ data = self.run_bzr("fast-import file.fi br")[0]
+ self.assertEquals(1, tree.branch.revno())