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