<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[51889] trunk/WebKitTools</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/51889">51889</a></dd>
<dt>Author</dt> <dd>abarth@webkit.org</dd>
<dt>Date</dt> <dd>2009-12-09 00:20:57 -0800 (Wed, 09 Dec 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>2009-12-09  Adam Barth  &lt;abarth@webkit.org&gt;

        Reviewed by Eric Seidel.

        [bzt] Implement abstract Steps
        https://bugs.webkit.org/show_bug.cgi?id=32212

        This is a fairly disruptive change that refactors how we build
        commands.  Instead of using a landing sequence, we can now assemble a
        sequence of steps directly.  We still use the landing sequence in the
        interim, but this will be removed soon.

        * Scripts/bugzilla-tool:
        * Scripts/modules/buildsteps.py:
        * Scripts/modules/commands/download.py:
        * Scripts/modules/commands/early_warning_system.py:
        * Scripts/modules/commands/queues.py:
        * Scripts/modules/commands/queues_unittest.py:
        * Scripts/modules/landingsequence.py:
        * Scripts/modules/mock_bugzillatool.py:
        * Scripts/modules/processutils.py: Removed.
        * Scripts/modules/scm.py:
        * Scripts/modules/scm_unittest.py:
        * Scripts/modules/webkitport.py:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebKitToolsChangeLog">trunk/WebKitTools/ChangeLog</a></li>
<li><a href="#trunkWebKitToolsScriptsbugzillatool">trunk/WebKitTools/Scripts/bugzilla-tool</a></li>
<li><a href="#trunkWebKitToolsScriptsmodulesbuildstepspy">trunk/WebKitTools/Scripts/modules/buildsteps.py</a></li>
<li><a href="#trunkWebKitToolsScriptsmodulescommandsdownloadpy">trunk/WebKitTools/Scripts/modules/commands/download.py</a></li>
<li><a href="#trunkWebKitToolsScriptsmodulescommandsearly_warning_systempy">trunk/WebKitTools/Scripts/modules/commands/early_warning_system.py</a></li>
<li><a href="#trunkWebKitToolsScriptsmodulescommandsqueuespy">trunk/WebKitTools/Scripts/modules/commands/queues.py</a></li>
<li><a href="#trunkWebKitToolsScriptsmodulescommandsqueues_unittestpy">trunk/WebKitTools/Scripts/modules/commands/queues_unittest.py</a></li>
<li><a href="#trunkWebKitToolsScriptsmoduleslandingsequencepy">trunk/WebKitTools/Scripts/modules/landingsequence.py</a></li>
<li><a href="#trunkWebKitToolsScriptsmodulesmock_bugzillatoolpy">trunk/WebKitTools/Scripts/modules/mock_bugzillatool.py</a></li>
<li><a href="#trunkWebKitToolsScriptsmodulesscmpy">trunk/WebKitTools/Scripts/modules/scm.py</a></li>
<li><a href="#trunkWebKitToolsScriptsmodulesscm_unittestpy">trunk/WebKitTools/Scripts/modules/scm_unittest.py</a></li>
<li><a href="#trunkWebKitToolsScriptsmoduleswebkitportpy">trunk/WebKitTools/Scripts/modules/webkitport.py</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkWebKitToolsScriptsmodulesprocessutilspy">trunk/WebKitTools/Scripts/modules/processutils.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebKitToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/ChangeLog (51888 => 51889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/ChangeLog        2009-12-09 07:51:39 UTC (rev 51888)
+++ trunk/WebKitTools/ChangeLog        2009-12-09 08:20:57 UTC (rev 51889)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2009-12-09  Adam Barth  &lt;abarth@webkit.org&gt;
+
+        Reviewed by Eric Seidel.
+
+        [bzt] Implement abstract Steps
+        https://bugs.webkit.org/show_bug.cgi?id=32212
+
+        This is a fairly disruptive change that refactors how we build
+        commands.  Instead of using a landing sequence, we can now assemble a
+        sequence of steps directly.  We still use the landing sequence in the
+        interim, but this will be removed soon.
+
+        * Scripts/bugzilla-tool:
+        * Scripts/modules/buildsteps.py:
+        * Scripts/modules/commands/download.py:
+        * Scripts/modules/commands/early_warning_system.py:
+        * Scripts/modules/commands/queues.py:
+        * Scripts/modules/commands/queues_unittest.py:
+        * Scripts/modules/landingsequence.py:
+        * Scripts/modules/mock_bugzillatool.py:
+        * Scripts/modules/processutils.py: Removed.
+        * Scripts/modules/scm.py:
+        * Scripts/modules/scm_unittest.py:
+        * Scripts/modules/webkitport.py:
+
</ins><span class="cx"> 2009-12-08  Eric Seidel  &lt;eric@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Adam Barth.
</span></span></pre></div>
<a id="trunkWebKitToolsScriptsbugzillatool"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/Scripts/bugzilla-tool (51888 => 51889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/Scripts/bugzilla-tool        2009-12-09 07:51:39 UTC (rev 51888)
+++ trunk/WebKitTools/Scripts/bugzilla-tool        2009-12-09 08:20:57 UTC (rev 51889)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> from modules.commands.queries import *
</span><span class="cx"> from modules.commands.queues import *
</span><span class="cx"> from modules.commands.upload import *
</span><ins>+from modules.executive import Executive
</ins><span class="cx"> from modules.logging import log
</span><span class="cx"> from modules.multicommandtool import MultiCommandTool
</span><span class="cx"> from modules.scm import detect_scm_system
</span><span class="lines">@@ -51,6 +52,7 @@
</span><span class="cx"> 
</span><span class="cx">         self.bugs = Bugzilla()
</span><span class="cx">         self.buildbot = BuildBot()
</span><ins>+        self.executive = Executive()
</ins><span class="cx">         self._scm = None
</span><span class="cx">         self._status = None
</span><span class="cx">         self.steps = BuildSteps()
</span></span></pre></div>
<a id="trunkWebKitToolsScriptsmodulesbuildstepspy"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/Scripts/modules/buildsteps.py (51888 => 51889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/Scripts/modules/buildsteps.py        2009-12-09 07:51:39 UTC (rev 51888)
+++ trunk/WebKitTools/Scripts/modules/buildsteps.py        2009-12-09 08:20:57 UTC (rev 51889)
</span><span class="lines">@@ -30,75 +30,227 @@
</span><span class="cx"> 
</span><span class="cx"> from optparse import make_option
</span><span class="cx"> 
</span><ins>+from modules.comments import bug_comment_from_commit_text
</ins><span class="cx"> from modules.logging import log, error
</span><del>-from modules.processutils import run_and_throw_if_fail
</del><span class="cx"> from modules.webkitport import WebKitPort
</span><span class="cx"> 
</span><del>-class BuildSteps:
-    # FIXME: The options should really live on each &quot;Step&quot; object.
-    @staticmethod
-    def cleaning_options():
</del><ins>+
+class CommandOptions(object):
+    force_clean = make_option(&quot;--force-clean&quot;, action=&quot;store_true&quot;, dest=&quot;force_clean&quot;, default=False, help=&quot;Clean working directory before applying patches (removes local changes and commits)&quot;)
+    clean = make_option(&quot;--no-clean&quot;, action=&quot;store_false&quot;, dest=&quot;clean&quot;, default=True, help=&quot;Don't check if the working directory is clean before applying patches&quot;)
+    check_builders = make_option(&quot;--ignore-builders&quot;, action=&quot;store_false&quot;, dest=&quot;check_builders&quot;, default=True, help=&quot;Don't check to see if the build.webkit.org builders are green before landing.&quot;)
+    quiet = make_option(&quot;--quiet&quot;, action=&quot;store_true&quot;, dest=&quot;quiet&quot;, default=False, help=&quot;Produce less console output.&quot;)
+    non_interactive = make_option(&quot;--non-interactive&quot;, action=&quot;store_true&quot;, dest=&quot;non_interactive&quot;, default=False, help=&quot;Never prompt the user, fail as fast as possible.&quot;)
+    parent_command = make_option(&quot;--parent-command&quot;, action=&quot;store&quot;, dest=&quot;parent_command&quot;, default=None, help=&quot;(Internal) The command that spawned this instance.&quot;)
+    update = make_option(&quot;--no-update&quot;, action=&quot;store_false&quot;, dest=&quot;update&quot;, default=True, help=&quot;Don't update the working directory.&quot;)
+    build = make_option(&quot;--no-build&quot;, action=&quot;store_false&quot;, dest=&quot;build&quot;, default=True, help=&quot;Commit without building first, implies --no-test.&quot;)
+    test = make_option(&quot;--no-test&quot;, action=&quot;store_false&quot;, dest=&quot;test&quot;, default=True, help=&quot;Commit without running run-webkit-tests.&quot;)
+    close_bug = make_option(&quot;--no-close&quot;, action=&quot;store_false&quot;, dest=&quot;close_bug&quot;, default=True, help=&quot;Leave bug open after landing.&quot;)
+    port = make_option(&quot;--port&quot;, action=&quot;store&quot;, dest=&quot;port&quot;, default=None, help=&quot;Specify a port (e.g., mac, qt, gtk, ...).&quot;)
+
+
+class AbstractStep(object):
+    def __init__(self, tool, options):
+        self._tool = tool
+        self._options = options
+        self._port = None
+
+    def _run_script(self, script_name, quiet=False, port=WebKitPort):
+        log(&quot;Running %s&quot; % script_name)
+        self._tool.executive.run_and_throw_if_fail(port.script_path(script_name), quiet)
+
+    # FIXME: The port should live on the tool.
+    def port(self):
+        if self._port:
+            return self._port
+        self._port = WebKitPort.port(self._options.port)
+        return self._port
+
+    @classmethod
+    def options(cls):
+        return []
+
+    def run(self, tool):
+        raise NotImplementedError, &quot;subclasses must implement&quot;
+
+
+class AbstractPatchStep(AbstractStep):
+    def __init__(self, tool, options, patch):
+        AbstractStep.__init__(self, tool, options)
+        self._patch = patch
+
+
+class PrepareChangelogStep(AbstractStep):
+    def run(self):
+        self._run_script(&quot;prepare-ChangeLog&quot;)
+
+
+class CleanWorkingDirectoryStep(AbstractStep):
+    def __init__(self, tool, options, allow_local_commits=False):
+        AbstractStep.__init__(self, tool, options)
+        self._allow_local_commits = allow_local_commits
+
+    @classmethod
+    def options(cls):
</ins><span class="cx">         return [
</span><del>-            make_option(&quot;--force-clean&quot;, action=&quot;store_true&quot;, dest=&quot;force_clean&quot;, default=False, help=&quot;Clean working directory before applying patches (removes local changes and commits)&quot;),
-            make_option(&quot;--no-clean&quot;, action=&quot;store_false&quot;, dest=&quot;clean&quot;, default=True, help=&quot;Don't check if the working directory is clean before applying patches&quot;),
</del><ins>+            CommandOptions.force_clean,
+            CommandOptions.clean,
</ins><span class="cx">         ]
</span><span class="cx"> 
</span><del>-    # FIXME: These distinctions are bogus.  We need a better model for handling options.
-    @staticmethod
-    def build_options():
</del><ins>+    def run(self):
+        os.chdir(self._tool._scm.checkout_root)
+        if not self._allow_local_commits:
+            self._tool.scm().ensure_no_local_commits(self._options.force_clean)
+        if self._options.clean:
+            self._tool.scm().ensure_clean_working_directory(force_clean=self._options.force_clean)
+
+
+class UpdateStep(AbstractStep):
+    @classmethod
+    def options(cls):
</ins><span class="cx">         return [
</span><del>-            make_option(&quot;--ignore-builders&quot;, action=&quot;store_false&quot;, dest=&quot;check_builders&quot;, default=True, help=&quot;Don't check to see if the build.webkit.org builders are green before landing.&quot;),
-            make_option(&quot;--quiet&quot;, action=&quot;store_true&quot;, dest=&quot;quiet&quot;, default=False, help=&quot;Produce less console output.&quot;),
-            make_option(&quot;--non-interactive&quot;, action=&quot;store_true&quot;, dest=&quot;non_interactive&quot;, default=False, help=&quot;Never prompt the user, fail as fast as possible.&quot;),
-            make_option(&quot;--parent-command&quot;, action=&quot;store&quot;, dest=&quot;parent_command&quot;, default=None, help=&quot;(Internal) The command that spawned this instance.&quot;),
-        ] + WebKitPort.port_options()
</del><ins>+            CommandOptions.update,
+            CommandOptions.port,
+        ]
</ins><span class="cx"> 
</span><del>-    @staticmethod
-    def land_options():
</del><ins>+    def run(self):
+        if not self._options.update:
+            return
+        log(&quot;Updating working directory&quot;)
+        self._tool.executive.run_and_throw_if_fail(self.port().update_webkit_command())
+
+
+class ApplyPatchStep(AbstractPatchStep):
+    @classmethod
+    def options(cls):
</ins><span class="cx">         return [
</span><del>-            make_option(&quot;--no-update&quot;, action=&quot;store_false&quot;, dest=&quot;update&quot;, default=True, help=&quot;Don't update the working directory.&quot;),
-            make_option(&quot;--no-build&quot;, action=&quot;store_false&quot;, dest=&quot;build&quot;, default=True, help=&quot;Commit without building first, implies --no-test.&quot;),
-            make_option(&quot;--no-test&quot;, action=&quot;store_false&quot;, dest=&quot;test&quot;, default=True, help=&quot;Commit without running run-webkit-tests.&quot;),
-            make_option(&quot;--no-close&quot;, action=&quot;store_false&quot;, dest=&quot;close_bug&quot;, default=True, help=&quot;Leave bug open after landing.&quot;),
</del><ins>+            CommandOptions.non_interactive,
</ins><span class="cx">         ]
</span><span class="cx"> 
</span><del>-    def _run_script(cls, script_name, quiet=False, port=WebKitPort):
-        log(&quot;Running %s&quot; % script_name)
-        run_and_throw_if_fail(port.script_path(script_name), quiet)
</del><ins>+    def run(self):
+        log(&quot;Processing patch %s from bug %s.&quot; % (self._patch[&quot;id&quot;], self._patch[&quot;bug_id&quot;]))
+        self._tool.scm().apply_patch(self._patch, force=self._options.non_interactive)
</ins><span class="cx"> 
</span><del>-    def prepare_changelog(self):
-        self.run_script(&quot;prepare-ChangeLog&quot;)
</del><span class="cx"> 
</span><del>-    def clean_working_directory(self, scm, options, allow_local_commits=False):
-        os.chdir(scm.checkout_root)
-        if not allow_local_commits:
-            scm.ensure_no_local_commits(options.force_clean)
-        if options.clean:
-            scm.ensure_clean_working_directory(force_clean=options.force_clean)
</del><ins>+class EnsureBuildersAreGreenStep(AbstractStep):
+    @classmethod
+    def options(cls):
+        return [
+            CommandOptions.check_builders,
+        ]
</ins><span class="cx"> 
</span><del>-    def update(self, port=WebKitPort):
-        log(&quot;Updating working directory&quot;)
-        run_and_throw_if_fail(port.update_webkit_command())
</del><ins>+    def run(self):
+        if not self._options.check_builders:
+            return
+        if not self._tool.buildbot.core_builders_are_green():
+            error(&quot;Builders at %s are red, please do not commit.  Pass --ignore-builders to bypass this check.&quot; % (self._tool.buildbot.buildbot_host))
</ins><span class="cx"> 
</span><del>-    def run_tests(self, launch_safari, fail_fast=False, quiet=False, port=WebKitPort):
-        args = port.run_webkit_tests_command()
-        if not launch_safari:
</del><ins>+
+class BuildStep(AbstractStep):
+    @classmethod
+    def options(cls):
+        return [
+            CommandOptions.build,
+            CommandOptions.quiet,
+        ]
+
+    def run(self):
+        if not self._options.build:
+            return
+        log(&quot;Building WebKit&quot;)
+        self._tool.executive.run_and_throw_if_fail(self.port().build_webkit_command(), self._options.quiet)
+
+
+class CheckStyleStep(AbstractStep):
+    def run(self):
+        self._run_script(&quot;check-webkit-style&quot;)
+
+
+class RunTestsStep(AbstractStep):
+    @classmethod
+    def options(cls):
+        return [
+            CommandOptions.build,
+            CommandOptions.test,
+            CommandOptions.non_interactive,
+            CommandOptions.quiet,
+            CommandOptions.port,
+        ]
+
+    def run(self):
+        if not self._options.build:
+            return
+        if not self._options.test:
+            return
+        args = self.port().run_webkit_tests_command()
+        if self._options.non_interactive:
</ins><span class="cx">             args.append(&quot;--no-launch-safari&quot;)
</span><del>-        if quiet:
</del><ins>+            args.append(&quot;--exit-after-n-failures=1&quot;)
+        if self._options.quiet:
</ins><span class="cx">             args.append(&quot;--quiet&quot;)
</span><del>-        if fail_fast:
-            args.append(&quot;--exit-after-n-failures=1&quot;)
-        run_and_throw_if_fail(args)
</del><ins>+        self._tool.executive.run_and_throw_if_fail(args)
</ins><span class="cx"> 
</span><del>-    def ensure_builders_are_green(self, buildbot, options):
-        if not options.check_builders or buildbot.core_builders_are_green():
</del><ins>+
+class CommitStep(AbstractStep):
+    def run(self):
+        commit_message = self._tool.scm().commit_message_for_this_commit()
+        return self._tool.scm().commit_with_message(commit_message.message())
+
+
+class ClosePatchStep(AbstractPatchStep):
+    def run(self, commit_log):
+        comment_text = bug_comment_from_commit_text(self._tool.scm(), commit_log)
+        self._tool.bugs.clear_attachment_flags(self._patch[&quot;id&quot;], comment_text)
+
+
+class CloseBugStep(AbstractPatchStep):
+    @classmethod
+    def options(cls):
+        return [
+            CommandOptions.close_bug,
+        ]
+
+    def run(self):
+        if not self._options.close_bug:
</ins><span class="cx">             return
</span><del>-        error(&quot;Builders at %s are red, please do not commit.  Pass --ignore-builders to bypass this check.&quot; % (buildbot.buildbot_host))
</del><ins>+        # Check to make sure there are no r? or r+ patches on the bug before closing.
+        # Assume that r- patches are just previous patches someone forgot to obsolete.
+        patches = self._tool.bugs.fetch_patches_from_bug(self._patch[&quot;bug_id&quot;])
+        for patch in patches:
+            review_flag = patch.get(&quot;review&quot;)
+            if review_flag == &quot;?&quot; or review_flag == &quot;+&quot;:
+                log(&quot;Not closing bug %s as attachment %s has review=%s.  Assuming there are more patches to land from this bug.&quot; % (patch[&quot;bug_id&quot;], patch[&quot;id&quot;], review_flag))
+                return
+        self._tool.bugs.close_bug_as_fixed(self._patch[&quot;bug_id&quot;], &quot;All reviewed patches have been landed.  Closing bug.&quot;)
</ins><span class="cx"> 
</span><del>-    def build_webkit(self, quiet=False, port=WebKitPort):
-        log(&quot;Building WebKit&quot;)
-        run_and_throw_if_fail(port.build_webkit_command(), quiet)
</del><span class="cx"> 
</span><del>-    def check_style(self):
-        self._run_script(&quot;check-webkit-style&quot;)
</del><ins>+# FIXME: This class is a dinosaur and should be extinct soon.
+class BuildSteps:
+    # FIXME: The options should really live on each &quot;Step&quot; object.
+    @staticmethod
+    def cleaning_options():
+        return [
+            CommandOptions.force_clean,
+            CommandOptions.clean,
+        ]
</ins><span class="cx"> 
</span><ins>+    # FIXME: These distinctions are bogus.  We need a better model for handling options.
+    @staticmethod
+    def build_options():
+        return [
+            CommandOptions.check_builders,
+            CommandOptions.quiet,
+            CommandOptions.non_interactive,
+            CommandOptions.parent_command,
+            CommandOptions.port,
+        ]
+
+    @staticmethod
+    def land_options():
+        return [
+            CommandOptions.update,
+            CommandOptions.build,
+            CommandOptions.test,
+            CommandOptions.close_bug,
+        ]
+
</ins></span></pre></div>
<a id="trunkWebKitToolsScriptsmodulescommandsdownloadpy"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/Scripts/modules/commands/download.py (51888 => 51889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/Scripts/modules/commands/download.py        2009-12-09 07:51:39 UTC (rev 51888)
+++ trunk/WebKitTools/Scripts/modules/commands/download.py        2009-12-09 08:20:57 UTC (rev 51889)
</span><span class="lines">@@ -33,20 +33,17 @@
</span><span class="cx"> from optparse import make_option
</span><span class="cx"> 
</span><span class="cx"> from modules.bugzilla import parse_bug_id
</span><del>-from modules.buildsteps import BuildSteps
</del><ins>+from modules.buildsteps import BuildSteps, EnsureBuildersAreGreenStep, CleanWorkingDirectoryStep, UpdateStep, CheckStyleStep, PrepareChangelogStep, CleanWorkingDirectoryStep
</ins><span class="cx"> from modules.changelogs import ChangeLog
</span><span class="cx"> from modules.comments import bug_comment_from_commit_text
</span><span class="cx"> from modules.grammar import pluralize
</span><del>-from modules.landingsequence import LandingSequence, ConditionalLandingSequence
</del><ins>+from modules.landingsequence import LandingSequence
</ins><span class="cx"> from modules.logging import error, log
</span><span class="cx"> from modules.multicommandtool import Command
</span><span class="cx"> from modules.processutils import ScriptError
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class BuildSequence(ConditionalLandingSequence):
-    def __init__(self, options, tool):
-        ConditionalLandingSequence.__init__(self, None, options, tool)
-
</del><ins>+class BuildSequence(LandingSequence):
</ins><span class="cx">     def run(self):
</span><span class="cx">         self.clean()
</span><span class="cx">         self.update()
</span><span class="lines">@@ -63,7 +60,7 @@
</span><span class="cx">         Command.__init__(self, &quot;Update working copy and build&quot;, &quot;&quot;, options)
</span><span class="cx"> 
</span><span class="cx">     def execute(self, options, args, tool):
</span><del>-        sequence = BuildSequence(options, tool)
</del><ins>+        sequence = BuildSequence(None, options, tool)
</ins><span class="cx">         sequence.run_and_handle_errors()
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -107,9 +104,10 @@
</span><span class="cx"> 
</span><span class="cx">     @staticmethod
</span><span class="cx">     def setup_for_patch_apply(tool, options):
</span><del>-        tool.steps.clean_working_directory(tool.scm(), options, allow_local_commits=True)
-        if options.update:
-            tool.steps.update()
</del><ins>+        clean_step = CleanWorkingDirectoryStep(tool, options, allow_local_commits=True)
+        clean_step.run()
+        update_step = UpdateStep(tool, options)
+        update_step.run()
</ins><span class="cx"> 
</span><span class="cx">     @staticmethod
</span><span class="cx">     def apply_patches_with_options(scm, patches, options):
</span><span class="lines">@@ -124,10 +122,7 @@
</span><span class="cx">                 scm.commit_locally_with_message(commit_message.message() or patch[&quot;name&quot;])
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class LandDiffSequence(ConditionalLandingSequence):
-    def __init__(self, patch, options, tool):
-        ConditionalLandingSequence.__init__(self, patch, options, tool)
-
</del><ins>+class LandDiffSequence(LandingSequence):
</ins><span class="cx">     def run(self):
</span><span class="cx">         self.check_builders()
</span><span class="cx">         self.build()
</span><span class="lines">@@ -189,7 +184,7 @@
</span><span class="cx">     def execute(self, options, args, tool):
</span><span class="cx">         bug_id = (args and args[0]) or parse_bug_id(tool.scm().create_patch())
</span><span class="cx"> 
</span><del>-        tool.steps.ensure_builders_are_green(tool.buildbot, options)
</del><ins>+        EnsureBuildersAreGreenStep(tool, options).run()
</ins><span class="cx"> 
</span><span class="cx">         os.chdir(tool.scm().checkout_root)
</span><span class="cx">         self.update_changelogs_with_reviewer(options.reviewer, bug_id, tool)
</span><span class="lines">@@ -234,9 +229,6 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> class CheckStyleSequence(LandingSequence):
</span><del>-    def __init__(self, patch, options, tool):
-        LandingSequence.__init__(self, patch, options, tool)
-
</del><span class="cx">     def run(self):
</span><span class="cx">         self.clean()
</span><span class="cx">         self.update()
</span><span class="lines">@@ -245,7 +237,8 @@
</span><span class="cx"> 
</span><span class="cx">     def build(self):
</span><span class="cx">         # Instead of building, we check style.
</span><del>-        self._tool.steps.check_style()
</del><ins>+        step = CheckStyleStep(self._tool, self._options)
+        step.run()
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> class CheckStyle(AbstractPatchProcessingCommand):
</span><span class="lines">@@ -267,10 +260,7 @@
</span><span class="cx">         sequence.run_and_handle_errors()
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class BuildAttachmentSequence(ConditionalLandingSequence):
-    def __init__(self, patch, options, tool):
-        LandingSequence.__init__(self, patch, options, tool)
-
</del><ins>+class BuildAttachmentSequence(LandingSequence):
</ins><span class="cx">     def run(self):
</span><span class="cx">         self.clean()
</span><span class="cx">         self.update()
</span><span class="lines">@@ -307,10 +297,10 @@
</span><span class="cx"> 
</span><span class="cx">     def _prepare_to_process(self, options, args, tool):
</span><span class="cx">         # Check the tree status first so we can fail early.
</span><del>-        tool.steps.ensure_builders_are_green(tool.buildbot, options)
</del><ins>+        EnsureBuildersAreGreenStep(tool, options).run()
</ins><span class="cx"> 
</span><span class="cx">     def _process_patch(self, patch, options, args, tool):
</span><del>-        sequence = ConditionalLandingSequence(patch, options, tool)
</del><ins>+        sequence = LandingSequence(patch, options, tool)
</ins><span class="cx">         sequence.run_and_handle_errors()
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -358,7 +348,7 @@
</span><span class="cx"> 
</span><span class="cx">         # Second, make new ChangeLog entries for this rollout.
</span><span class="cx">         # This could move to prepare-ChangeLog by adding a --revert= option.
</span><del>-        tool.steps.prepare_changelog()
</del><ins>+        PrepareChangelogStep(tool, None).run()
</ins><span class="cx">         for changelog_path in changelog_paths:
</span><span class="cx">             ChangeLog(changelog_path).update_for_revert(revision)
</span><span class="cx"> 
</span><span class="lines">@@ -384,8 +374,8 @@
</span><span class="cx">             else:
</span><span class="cx">                 log(&quot;Failed to parse bug number from diff.  No bugs will be updated/reopened after the rollout.&quot;)
</span><span class="cx"> 
</span><del>-        tool.steps.clean_working_directory(tool.scm(), options)
-        tool.steps.update()
</del><ins>+        CleanWorkingDirectoryStep(tool, options).run()
+        UpdateStep(tool, options).run()
</ins><span class="cx">         tool.scm().apply_reverse_diff(revision)
</span><span class="cx">         self._create_changelogs_for_revert(tool, revision)
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebKitToolsScriptsmodulescommandsearly_warning_systempy"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/Scripts/modules/commands/early_warning_system.py (51888 => 51889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/Scripts/modules/commands/early_warning_system.py        2009-12-09 07:51:39 UTC (rev 51888)
+++ trunk/WebKitTools/Scripts/modules/commands/early_warning_system.py        2009-12-09 08:20:57 UTC (rev 51889)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> 
</span><span class="cx"> from modules.commands.queues import AbstractReviewQueue
</span><del>-from modules.processutils import ScriptError
</del><ins>+from modules.executive import ScriptError
</ins><span class="cx"> from modules.webkitport import WebKitPort
</span><span class="cx"> 
</span><span class="cx"> class AbstractEarlyWarningSystem(AbstractReviewQueue):
</span></span></pre></div>
<a id="trunkWebKitToolsScriptsmodulescommandsqueuespy"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/Scripts/modules/commands/queues.py (51888 => 51889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/Scripts/modules/commands/queues.py        2009-12-09 07:51:39 UTC (rev 51888)
+++ trunk/WebKitTools/Scripts/modules/commands/queues.py        2009-12-09 08:20:57 UTC (rev 51889)
</span><span class="lines">@@ -33,12 +33,12 @@
</span><span class="cx"> from datetime import datetime
</span><span class="cx"> from optparse import make_option
</span><span class="cx"> 
</span><ins>+from modules.executive import ScriptError
</ins><span class="cx"> from modules.grammar import pluralize
</span><del>-from modules.landingsequence import LandingSequence, ConditionalLandingSequence, LandingSequenceErrorHandler
</del><ins>+from modules.landingsequence import LandingSequence, LandingSequenceErrorHandler
</ins><span class="cx"> from modules.logging import error, log
</span><span class="cx"> from modules.multicommandtool import Command
</span><span class="cx"> from modules.patchcollection import PatchCollection, PersistentPatchCollection, PersistentPatchCollectionDelegate
</span><del>-from modules.processutils import run_and_throw_if_fail, ScriptError
</del><span class="cx"> from modules.statusbot import StatusBot
</span><span class="cx"> from modules.workqueue import WorkQueue, WorkQueueDelegate
</span><span class="cx"> 
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx"> 
</span><span class="cx">     def run_bugzilla_tool(self, args):
</span><span class="cx">         bugzilla_tool_args = [self.tool.path()] + map(str, args)
</span><del>-        run_and_throw_if_fail(bugzilla_tool_args)
</del><ins>+        self.tool.executive.run_and_throw_if_fail(bugzilla_tool_args)
</ins><span class="cx"> 
</span><span class="cx">     def log_progress(self, patch_ids):
</span><span class="cx">         log(&quot;%s in %s [%s]&quot; % (pluralize(&quot;patch&quot;, len(patch_ids)), self.name, &quot;, &quot;.join(map(str, patch_ids))))
</span></span></pre></div>
<a id="trunkWebKitToolsScriptsmodulescommandsqueues_unittestpy"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/Scripts/modules/commands/queues_unittest.py (51888 => 51889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/Scripts/modules/commands/queues_unittest.py        2009-12-09 07:51:39 UTC (rev 51888)
+++ trunk/WebKitTools/Scripts/modules/commands/queues_unittest.py        2009-12-09 08:20:57 UTC (rev 51889)
</span><span class="lines">@@ -62,5 +62,5 @@
</span><span class="cx">         self._assert_output(queue.run_bugzilla_tool, [run_args], expected_stdout=tool_output)
</span><span class="cx"> 
</span><span class="cx">     def test_run_bugzilla_tool(self):
</span><del>-        self._assert_run_bugzilla_tool_output([1], &quot;1\n&quot;)
-        self._assert_run_bugzilla_tool_output([&quot;one&quot;, 2], &quot;one 2\n&quot;)
</del><ins>+        self._assert_run_bugzilla_tool_output([1], &quot;&quot;)
+        self._assert_run_bugzilla_tool_output([&quot;one&quot;, 2], &quot;&quot;)
</ins></span></pre></div>
<a id="trunkWebKitToolsScriptsmoduleslandingsequencepy"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/Scripts/modules/landingsequence.py (51888 => 51889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/Scripts/modules/landingsequence.py        2009-12-09 07:51:39 UTC (rev 51888)
+++ trunk/WebKitTools/Scripts/modules/landingsequence.py        2009-12-09 08:20:57 UTC (rev 51889)
</span><span class="lines">@@ -34,7 +34,9 @@
</span><span class="cx"> from modules.scm import CheckoutNeedsUpdate
</span><span class="cx"> from modules.webkitport import WebKitPort
</span><span class="cx"> from modules.workqueue import WorkQueue
</span><ins>+from modules.buildsteps import CleanWorkingDirectoryStep, UpdateStep, ApplyPatchStep, EnsureBuildersAreGreenStep, BuildStep, RunTestsStep, CommitStep, ClosePatchStep, CloseBugStep
</ins><span class="cx"> 
</span><ins>+
</ins><span class="cx"> class LandingSequenceErrorHandler():
</span><span class="cx">     @classmethod
</span><span class="cx">     def handle_script_error(cls, tool, patch, script_error):
</span><span class="lines">@@ -75,66 +77,37 @@
</span><span class="cx">             WorkQueue.exit_after_handled_error(e)
</span><span class="cx"> 
</span><span class="cx">     def clean(self):
</span><del>-        self._tool.steps.clean_working_directory(self._tool.scm(), self._options)
</del><ins>+        step = CleanWorkingDirectoryStep(self._tool, self._options)
+        step.run()
</ins><span class="cx"> 
</span><span class="cx">     def update(self):
</span><del>-        self._tool.steps.update(port=self._port)
</del><ins>+        step = UpdateStep(self._tool, self._options)
+        step.run()
</ins><span class="cx"> 
</span><span class="cx">     def apply_patch(self):
</span><del>-        log(&quot;Processing patch %s from bug %s.&quot; % (self._patch[&quot;id&quot;], self._patch[&quot;bug_id&quot;]))
-        self._tool.scm().apply_patch(self._patch, force=self._options.non_interactive)
</del><ins>+        step = ApplyPatchStep(self._tool, self._options, self._patch)
+        step.run()
</ins><span class="cx"> 
</span><span class="cx">     def check_builders(self):
</span><del>-        self._tool.steps.ensure_builders_are_green(self._tool.buildbot, self._options)
</del><ins>+        step = EnsureBuildersAreGreenStep(self._tool, self._options)
+        step.run()
</ins><span class="cx"> 
</span><span class="cx">     def build(self):
</span><del>-        self._tool.steps.build_webkit(quiet=self._options.quiet, port=self._port)
</del><ins>+        step = BuildStep(self._tool, self._options)
+        step.run()
</ins><span class="cx"> 
</span><span class="cx">     def test(self):
</span><del>-        # When running non-interactively we don't want to launch Safari and we want to exit after the first failure.
-        self._tool.steps.run_tests(launch_safari=not self._options.non_interactive, fail_fast=self._options.non_interactive, quiet=self._options.quiet, port=self._port)
</del><ins>+        step = RunTestsStep(self._tool, self._options)
+        step.run()
</ins><span class="cx"> 
</span><span class="cx">     def commit(self):
</span><del>-        commit_message = self._tool.scm().commit_message_for_this_commit()
-        return self._tool.scm().commit_with_message(commit_message.message())
</del><ins>+        step = CommitStep(self._tool, self._options)
+        return step.run()
</ins><span class="cx"> 
</span><span class="cx">     def close_patch(self, commit_log):
</span><del>-        comment_text = bug_comment_from_commit_text(self._tool.scm(), commit_log)
-        self._tool.bugs.clear_attachment_flags(self._patch[&quot;id&quot;], comment_text)
</del><ins>+        step = ClosePatchStep(self._tool, self._options, self._patch)
+        step.run(commit_log)
</ins><span class="cx"> 
</span><span class="cx">     def close_bug(self):
</span><del>-        # Check to make sure there are no r? or r+ patches on the bug before closing.
-        # Assume that r- patches are just previous patches someone forgot to obsolete.
-        patches = self._tool.bugs.fetch_patches_from_bug(self._patch[&quot;bug_id&quot;])
-        for patch in patches:
-            review_flag = patch.get(&quot;review&quot;)
-            if review_flag == &quot;?&quot; or review_flag == &quot;+&quot;:
-                log(&quot;Not closing bug %s as attachment %s has review=%s.  Assuming there are more patches to land from this bug.&quot; % (patch[&quot;bug_id&quot;], patch[&quot;id&quot;], review_flag))
-                return
-        self._tool.bugs.close_bug_as_fixed(self._patch[&quot;bug_id&quot;], &quot;All reviewed patches have been landed.  Closing bug.&quot;)
-
-
-class ConditionalLandingSequence(LandingSequence):
-    def __init__(self, patch, options, tool):
-        LandingSequence.__init__(self, patch, options, tool)
-
-    def update(self):
-        if self._options.update:
-            LandingSequence.update(self)
-
-    def check_builders(self):
-        if self._options.build:
-            LandingSequence.check_builders(self)
-
-    def build(self):
-        if self._options.build:
-            LandingSequence.build(self)
-
-    def test(self):
-        if self._options.build and self._options.test:
-            LandingSequence.test(self)
-
-    def close_bug(self):
-        if self._options.close_bug:
-            LandingSequence.close_bug(self)
-
</del><ins>+        step = CloseBugStep(self._tool, self._options, self._patch)
+        step.run()
</ins></span></pre></div>
<a id="trunkWebKitToolsScriptsmodulesmock_bugzillatoolpy"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/Scripts/modules/mock_bugzillatool.py (51888 => 51889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/Scripts/modules/mock_bugzillatool.py        2009-12-09 07:51:39 UTC (rev 51888)
+++ trunk/WebKitTools/Scripts/modules/mock_bugzillatool.py        2009-12-09 08:20:57 UTC (rev 51889)
</span><span class="lines">@@ -125,7 +125,7 @@
</span><span class="cx">     def __init__(self):
</span><span class="cx">         self.bugs = MockBugzilla()
</span><span class="cx">         self.buildbot = MockBuildBot()
</span><del>-        self.steps = Mock()
</del><ins>+        self.executive = Mock()
</ins><span class="cx">         self._scm = MockSCM()
</span><span class="cx"> 
</span><span class="cx">     def scm(self):
</span></span></pre></div>
<a id="trunkWebKitToolsScriptsmodulesprocessutilspy"></a>
<div class="delfile"><h4>Deleted: trunk/WebKitTools/Scripts/modules/processutils.py (51888 => 51889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/Scripts/modules/processutils.py        2009-12-09 07:51:39 UTC (rev 51888)
+++ trunk/WebKitTools/Scripts/modules/processutils.py        2009-12-09 08:20:57 UTC (rev 51889)
</span><span class="lines">@@ -1,113 +0,0 @@
</span><del>-# Copyright (c) 2009, Google Inc. All rights reserved.
-# Copyright (c) 2009 Apple Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-# 
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import os
-import StringIO
-import subprocess
-import sys
-
-from modules.logging import tee
-
-# FIXME: These methods could all be unified into one!
-
-class ScriptError(Exception):
-    def __init__(self, message=None, script_args=None, exit_code=None, output=None, cwd=None):
-        if not message:
-            message = 'Failed to run &quot;%s&quot;' % script_args
-            if exit_code:
-                message += &quot; exit_code: %d&quot; % exit_code
-            if cwd:
-                message += &quot; cwd: %s&quot; % cwd
-
-        Exception.__init__(self, message)
-        self.script_args = script_args # 'args' is already used by Exception
-        self.exit_code = exit_code
-        self.output = output
-        self.cwd = cwd
-
-    def message_with_output(self, output_limit=500):
-        if self.output:
-            if output_limit and len(self.output) &gt; output_limit:
-                 return &quot;%s\nLast %s characters of output:\n%s&quot; % (self, output_limit, self.output[-output_limit:])
-            return &quot;%s\n%s&quot; % (self, self.output)
-        return str(self)
-
-def default_error_handler(error):
-    raise error
-
-def ignore_error(error):
-    pass
-
-def run_command_with_teed_output(args, teed_output):
-    child_process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-
-    # Use our own custom wait loop because Popen ignores a tee'd stderr/stdout.
-    # FIXME: This could be improved not to flatten output to stdout.
-    while True:
-        output_line = child_process.stdout.readline()
-        if output_line == &quot;&quot; and child_process.poll() != None:
-            return child_process.poll()
-        teed_output.write(output_line)
-
-def run_command(args, cwd=None, input=None, error_handler=default_error_handler, return_exit_code=False, return_stderr=True):
-    if hasattr(input, 'read'): # Check if the input is a file.
-        stdin = input
-        string_to_communicate = None
-    else:
-        stdin = subprocess.PIPE if input else None
-        string_to_communicate = input
-    if return_stderr:
-        stderr = subprocess.STDOUT
-    else:
-        stderr = None
-    process = subprocess.Popen(args, stdin=stdin, stdout=subprocess.PIPE, stderr=stderr, cwd=cwd)
-    output = process.communicate(string_to_communicate)[0]
-    exit_code = process.wait()
-    if exit_code:
-        script_error = ScriptError(script_args=args, exit_code=exit_code, output=output, cwd=cwd)
-        error_handler(script_error)
-    if return_exit_code:
-        return exit_code
-    return output
-
-def run_and_throw_if_fail(args, quiet=False):
-    # Cache the child's output locally so it can be used for error reports.
-    child_out_file = StringIO.StringIO()
-    if quiet:
-        dev_null = open(os.devnull, &quot;w&quot;)
-    child_stdout = tee(child_out_file, dev_null if quiet else sys.stdout)
-    exit_code = run_command_with_teed_output(args, child_stdout)
-    if quiet:
-        dev_null.close()
-
-    child_output = child_out_file.getvalue()
-    child_out_file.close()
-
-    if exit_code:
-        raise ScriptError(script_args=args, exit_code=exit_code, output=child_output)
</del></span></pre></div>
<a id="trunkWebKitToolsScriptsmodulesscmpy"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/Scripts/modules/scm.py (51888 => 51889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/Scripts/modules/scm.py        2009-12-09 07:51:39 UTC (rev 51888)
+++ trunk/WebKitTools/Scripts/modules/scm.py        2009-12-09 08:20:57 UTC (rev 51889)
</span><span class="lines">@@ -35,8 +35,8 @@
</span><span class="cx"> 
</span><span class="cx"> # Import WebKit-specific modules.
</span><span class="cx"> from modules.changelogs import ChangeLog
</span><ins>+from modules.executive import run_command, ScriptError, default_error_handler, ignore_error
</ins><span class="cx"> from modules.logging import error, log
</span><del>-from modules.processutils import run_command, ScriptError, default_error_handler, ignore_error
</del><span class="cx"> 
</span><span class="cx"> def detect_scm_system(path):
</span><span class="cx">     if SVN.in_working_directory(path):
</span></span></pre></div>
<a id="trunkWebKitToolsScriptsmodulesscm_unittestpy"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/Scripts/modules/scm_unittest.py (51888 => 51889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/Scripts/modules/scm_unittest.py        2009-12-09 07:51:39 UTC (rev 51888)
+++ trunk/WebKitTools/Scripts/modules/scm_unittest.py        2009-12-09 08:20:57 UTC (rev 51889)
</span><span class="lines">@@ -38,13 +38,13 @@
</span><span class="cx"> import urllib
</span><span class="cx"> 
</span><span class="cx"> from datetime import date
</span><ins>+from modules.executive import run_command, ignore_error, ScriptError
</ins><span class="cx"> from modules.scm import detect_scm_system, SCM, CheckoutNeedsUpdate, commit_error_handler
</span><del>-from modules.processutils import run_command, ignore_error, ScriptError
</del><span class="cx"> 
</span><span class="cx"> # Eventually we will want to write tests which work for both scms. (like update_webkit, changed_files, etc.)
</span><span class="cx"> # Perhaps through some SCMTest base-class which both SVNTest and GitTest inherit from.
</span><span class="cx"> 
</span><del>-# FIXME: This should be unified into one of the processutils.py commands!
</del><ins>+# FIXME: This should be unified into one of the executive.py commands!
</ins><span class="cx"> def run_silent(args, cwd=None):
</span><span class="cx">     process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=cwd)
</span><span class="cx">     process.communicate() # ignore output
</span></span></pre></div>
<a id="trunkWebKitToolsScriptsmoduleswebkitportpy"></a>
<div class="modfile"><h4>Modified: trunk/WebKitTools/Scripts/modules/webkitport.py (51888 => 51889)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKitTools/Scripts/modules/webkitport.py        2009-12-09 07:51:39 UTC (rev 51888)
+++ trunk/WebKitTools/Scripts/modules/webkitport.py        2009-12-09 08:20:57 UTC (rev 51889)
</span><span class="lines">@@ -39,12 +39,6 @@
</span><span class="cx">         return os.path.join(&quot;WebKitTools&quot;, &quot;Scripts&quot;, script_name)
</span><span class="cx"> 
</span><span class="cx">     @staticmethod
</span><del>-    def port_options():
-        return [
-            make_option(&quot;--port&quot;, action=&quot;store&quot;, dest=&quot;port&quot;, default=None, help=&quot;Specify a port (e.g., mac, qt, gtk, ...).&quot;),
-        ]
-
-    @staticmethod
</del><span class="cx">     def port(port_name):
</span><span class="cx">         if port_name == &quot;mac&quot;:
</span><span class="cx">             return MacPort
</span></span></pre>
</div>
</div>

</body>
</html>