From 5052e8f8a27c1c302f0914e6aad6c4e8377bd9bc Mon Sep 17 00:00:00 2001 From: Oleksandr Usov Date: Thu, 20 Oct 2011 19:16:36 +0100 Subject: Add preserve_all_history flag fast-import-filter --- cmds.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cmds.py b/cmds.py index d5aedd6..8b9ef13 100644 --- a/cmds.py +++ b/cmds.py @@ -387,6 +387,15 @@ class cmd_fast_import_filter(Command): User mapping is supported by both the fast-import and fast-import-filter commands. + :History rewriting: + + By default fast-import-filter does quite aggressive history rewriting. + Empty commits (or commits which had all their content filtered out) will + be removed, and so are the references to commits not included in the stream. + + Flag --preserve-all-history reverses this behavior and makes it possible to + use fast-import-filter on incremental streams. + :Examples: Create a new project from a library (note the trailing / on the @@ -415,15 +424,19 @@ class cmd_fast_import_filter(Command): Option('user-map', type=str, help="Path to file containing a map of user-ids.", ), + Option('preserve-all-history', + help="Preserve all commits and links between them" + ), ] encoding_type = 'exact' def run(self, source=None, verbose=False, include_paths=None, - exclude_paths=None, user_map=None): + exclude_paths=None, user_map=None, preserve_all_history=False): load_fastimport() from fastimport.processors import filter_processor params = { 'include_paths': include_paths, 'exclude_paths': exclude_paths, + 'preserve_all_history': preserve_all_history } from fastimport import parser stream = _get_source_stream(source) -- cgit v1.2.1 From 310366242244327fbe930f7ae5e86671c735b310 Mon Sep 17 00:00:00 2001 From: Oleksandr Usov Date: Fri, 21 Oct 2011 10:37:53 +0100 Subject: Command-line flag renamed to --dont-squash-empty-commits --- cmds.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmds.py b/cmds.py index 8b9ef13..0e0eae5 100644 --- a/cmds.py +++ b/cmds.py @@ -393,7 +393,7 @@ class cmd_fast_import_filter(Command): Empty commits (or commits which had all their content filtered out) will be removed, and so are the references to commits not included in the stream. - Flag --preserve-all-history reverses this behavior and makes it possible to + Flag --dont-squash-empty-commits reverses this behavior and makes it possible to use fast-import-filter on incremental streams. :Examples: @@ -424,19 +424,19 @@ class cmd_fast_import_filter(Command): Option('user-map', type=str, help="Path to file containing a map of user-ids.", ), - Option('preserve-all-history', + Option('dont-squash-empty-commits', help="Preserve all commits and links between them" ), ] encoding_type = 'exact' def run(self, source=None, verbose=False, include_paths=None, - exclude_paths=None, user_map=None, preserve_all_history=False): + exclude_paths=None, user_map=None, dont_squash_empty_commits=False): load_fastimport() from fastimport.processors import filter_processor params = { 'include_paths': include_paths, 'exclude_paths': exclude_paths, - 'preserve_all_history': preserve_all_history + 'squash_empty_commits': not dont_squash_empty_commits, } from fastimport import parser stream = _get_source_stream(source) -- cgit v1.2.1