diff options
| author | Oleksandr Usov <oleksandr.usov@tibra.com> | 2011-10-21 10:35:03 +0100 |
|---|---|---|
| committer | Oleksandr Usov <oleksandr.usov@tibra.com> | 2011-10-21 10:35:03 +0100 |
| commit | 23079098b160d57b04afc242d626838495cbffd3 (patch) | |
| tree | a0b81d1be960e391db1c8be9dc4ce8c83d607ea0 /fastimport/processors | |
| parent | bb159b3fd648e0ad523837adaf45031b2e24246c (diff) | |
| download | python-fastimport-git-23079098b160d57b04afc242d626838495cbffd3.tar.gz | |
Rename flag to squash_empty_commits and add few more tests with includes/excludes
Diffstat (limited to 'fastimport/processors')
| -rw-r--r-- | fastimport/processors/filter_processor.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fastimport/processors/filter_processor.py b/fastimport/processors/filter_processor.py index e007046..5076519 100644 --- a/fastimport/processors/filter_processor.py +++ b/fastimport/processors/filter_processor.py @@ -37,22 +37,22 @@ class FilterProcessor(processor.ImportProcessor): * exclude_paths - a list of paths that should not appear in the output stream - * preserve_all_history - if True filter processeor will be much more conservative - w.r.t. history handling -- it will preserve all commits and links between them, - including those to unknown revisions. This is primarily usefull for filtering - incremental streams + * squash_empty_commits - if set to False, filter processor will be much more + conservative w.r.t. history handling -- it will preserve all commits and + links between them, including those to unknown revisions. This is primarily + usefull for filtering incremental streams """ known_params = [ 'include_paths', 'exclude_paths', - 'preserve_all_history' + 'squash_empty_commits' ] def pre_process(self): self.includes = self.params.get('include_paths') self.excludes = self.params.get('exclude_paths') - self.preserve_all_history = bool(self.params.get('preserve_all_history')) + self.squash_empty_commits = bool(self.params.get('squash_empty_commits', True)) # What's the new root, if any self.new_root = helpers.common_directory(self.includes) # Buffer of blobs until we know we need them: mark -> cmd @@ -98,7 +98,7 @@ class FilterProcessor(processor.ImportProcessor): """Process a CommitCommand.""" # These pass through if they meet the filtering conditions interesting_filecmds = self._filter_filecommands(cmd.iter_files) - if interesting_filecmds or self.preserve_all_history: + if interesting_filecmds or not self.squash_empty_commits: # If all we have is a single deleteall, skip this commit if len(interesting_filecmds) == 1 and isinstance( interesting_filecmds[0], commands.FileDeleteAllCommand): @@ -116,7 +116,7 @@ class FilterProcessor(processor.ImportProcessor): self.referenced_blobs.append(fc.dataref) # Update from and merges to refer to commits in the output - if not self.preserve_all_history: + if self.squash_empty_commits: cmd.from_ = self._find_interesting_from(cmd.from_) cmd.merges = self._find_interesting_merges(cmd.merges) self.interesting_commits.add(cmd.id) |
