diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2010-11-06 18:06:28 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2010-11-06 18:06:28 +0100 |
commit | 0afb861bc01c53df93dba7858a061d6c274d3151 (patch) | |
tree | 6041295d907a4112934e9a1b75f826ad19ce7f04 | |
parent | 7e50ee34850a0f5db87417b91a4a288268fb4664 (diff) | |
download | python-fastimport-0afb861bc01c53df93dba7858a061d6c274d3151.tar.gz |
Fix tests.
-rw-r--r-- | fastimport/commands.py | 3 | ||||
-rw-r--r-- | fastimport/processors/filter_processor.py | 2 | ||||
-rw-r--r-- | fastimport/tests/test_head_tracking.py | 2 | ||||
-rw-r--r-- | fastimport/tests/test_parser.py | 2 |
4 files changed, 4 insertions, 5 deletions
diff --git a/fastimport/commands.py b/fastimport/commands.py index 5c68a76..fe2379b 100644 --- a/fastimport/commands.py +++ b/fastimport/commands.py @@ -208,8 +208,7 @@ class CommitCommand(ImportCommand): # file_iter may be a callable or an iterator if callable(self.file_iter): return self.file_iter() - elif self.file_iter: - return iter(self.file_iter) + return iter(self.file_iter) class FeatureCommand(ImportCommand): diff --git a/fastimport/processors/filter_processor.py b/fastimport/processors/filter_processor.py index 0228132..4f254ba 100644 --- a/fastimport/processors/filter_processor.py +++ b/fastimport/processors/filter_processor.py @@ -91,7 +91,7 @@ class FilterProcessor(processor.ImportProcessor): def commit_handler(self, cmd): """Process a CommitCommand.""" # These pass through if they meet the filtering conditions - interesting_filecmds = self._filter_filecommands(cmd.file_iter) + interesting_filecmds = self._filter_filecommands(cmd.iter_files) if interesting_filecmds: # If all we have is a single deleteall, skip this commit if len(interesting_filecmds) == 1 and isinstance( diff --git a/fastimport/tests/test_head_tracking.py b/fastimport/tests/test_head_tracking.py index 7a1ba64..4a2a018 100644 --- a/fastimport/tests/test_head_tracking.py +++ b/fastimport/tests/test_head_tracking.py @@ -227,7 +227,7 @@ class TestHeadTracking(testtools.TestCase): if isinstance(cmd, commands.CommitCommand): reftracker.track_heads(cmd) # eat the file commands - list(cmd.file_iter()) + list(cmd.iter_files()) elif isinstance(cmd, commands.ResetCommand): if cmd.from_ is not None: reftracker.track_heads_for_ref(cmd.ref, cmd.from_) diff --git a/fastimport/tests/test_parser.py b/fastimport/tests/test_parser.py index 6c0e009..6832df3 100644 --- a/fastimport/tests/test_parser.py +++ b/fastimport/tests/test_parser.py @@ -153,7 +153,7 @@ class TestImportParser(testtools.TestCase): for cmd in p.iter_commands(): result.append(cmd) if cmd.name == 'commit': - for fc in cmd.file_iter(): + for fc in cmd.iter_files(): result.append(fc) self.assertEqual(len(result), 17) cmd1 = result.pop(0) |