summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--cmds.py12
2 files changed, 14 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 3926888..32c469a 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,9 @@ Features
* New option --rewrite-tag-names for 'bzr fast-export'. (Alex Usov, #872601)
+* New option --dont-squash-empty-commits for 'bzr fast-import-filter'.
+ (Alex Usov, #877303)
+
0.11 2011-08-22
Bug fixes
diff --git a/cmds.py b/cmds.py
index 0e0eae5..06dc1f7 100644
--- a/cmds.py
+++ b/cmds.py
@@ -431,13 +431,23 @@ class cmd_fast_import_filter(Command):
encoding_type = 'exact'
def run(self, source=None, verbose=False, include_paths=None,
exclude_paths=None, user_map=None, dont_squash_empty_commits=False):
+ from bzrlib.errors import BzrCommandError
load_fastimport()
from fastimport.processors import filter_processor
params = {
'include_paths': include_paths,
'exclude_paths': exclude_paths,
- 'squash_empty_commits': not dont_squash_empty_commits,
}
+ if ('squash_empty_commits' in
+ filter_processor.FilterProcessor.known_params):
+ params['squash_empty_commits'] = (not dont_squash_empty_commits)
+ else:
+ if dont_squash_empty_commits:
+ raise BzrCommandError("installed python-fastimport does not "
+ "support not squashing empty commits. Please install "
+ " a newer python-fastimport to use "
+ "--dont-squash-empty-commits")
+
from fastimport import parser
stream = _get_source_stream(source)
user_mapper = _get_user_mapper(user_map)