summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-11-06 18:06:28 +0100
committerJelmer Vernooij <jelmer@samba.org>2010-11-06 18:06:28 +0100
commit0afb861bc01c53df93dba7858a061d6c274d3151 (patch)
tree6041295d907a4112934e9a1b75f826ad19ce7f04
parent7e50ee34850a0f5db87417b91a4a288268fb4664 (diff)
downloadpython-fastimport-0afb861bc01c53df93dba7858a061d6c274d3151.tar.gz
Fix tests.
-rw-r--r--fastimport/commands.py3
-rw-r--r--fastimport/processors/filter_processor.py2
-rw-r--r--fastimport/tests/test_head_tracking.py2
-rw-r--r--fastimport/tests/test_parser.py2
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)