Commit ab007213 authored by abarth@webkit.org's avatar abarth@webkit.org
Browse files

2009-12-14 Adam Barth <abarth@webkit.org>

        Reviewed by Eric Seidel.

        Kill _create_step_sequence
        https://bugs.webkit.org/show_bug.cgi?id=32539

        It's cleaner to represent not having these sequences as an empty
        sequence instead of None.

        * Scripts/modules/commands/download.py:
        * Scripts/modules/stepsequence.py:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52136 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8880aec5
......@@ -10,6 +10,19 @@
* Scripts/modules/credentials_unittest.py: Added.
* Scripts/run-webkit-unittests:
2009-12-14 Adam Barth <abarth@webkit.org>
Reviewed by Eric Seidel.
Kill _create_step_sequence
https://bugs.webkit.org/show_bug.cgi?id=32539
It's cleaner to represent not having these sequences as an empty
sequence instead of None.
* Scripts/modules/commands/download.py:
* Scripts/modules/stepsequence.py:
2009-12-14 Adam Barth <abarth@webkit.org>
Unreviewed. Address reviewer comments from an earlier patch. I didn't
......
......@@ -132,28 +132,19 @@ class AbstractPatchSequencingCommand(AbstractPatchProcessingCommand):
prepare_steps = None
main_steps = None
@staticmethod
def _create_step_sequence(steps):
if not steps:
return None, []
step_sequence = StepSequence(steps)
return step_sequence, step_sequence.options()
def __init__(self):
options = []
self._prepare_sequence, prepare_options = self._create_step_sequence(self.prepare_steps)
self._main_sequence, main_options = self._create_step_sequence(self.main_steps)
options = sorted(set(prepare_options + main_options))
self._prepare_sequence = StepSequence(self.prepare_steps)
self._main_sequence = StepSequence(self.main_steps)
options = sorted(set(self._prepare_sequence.options() + self._main_sequence.options()))
AbstractPatchProcessingCommand.__init__(self, options)
def _prepare_to_process(self, options, args, tool):
if self._prepare_sequence:
self._prepare_sequence.run_and_handle_errors(tool, options)
self._prepare_sequence.run_and_handle_errors(tool, options)
def _process_patch(self, patch, options, args, tool):
if self._main_sequence:
state = { "patch" : patch }
self._main_sequence.run_and_handle_errors(tool, options, state)
state = { "patch" : patch }
self._main_sequence.run_and_handle_errors(tool, options, state)
class ProcessAttachmentsMixin(object):
......
......@@ -41,7 +41,7 @@ class StepSequenceErrorHandler():
class StepSequence(object):
def __init__(self, steps):
self._steps = steps
self._steps = steps or []
def options(self):
collected_options = [
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment