2011-04-02 Patrick Gansterer <paroga@webkit.org>
authorparoga@webkit.org <paroga@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 2 Apr 2011 12:15:35 +0000 (12:15 +0000)
committerparoga@webkit.org <paroga@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 2 Apr 2011 12:15:35 +0000 (12:15 +0000)
        Reviewed by Eric Seidel.

        Remove AbstractStep._run_script and move script names to ports.py
        https://bugs.webkit.org/show_bug.cgi?id=57704

        Replace deprecated _run_script with _tool.executive.run_and_throw_if_fail.

        * Scripts/webkitpy/common/config/ports.py:
        * Scripts/webkitpy/tool/commands/download_unittest.py:
        * Scripts/webkitpy/tool/commands/roll_unittest.py:
        * Scripts/webkitpy/tool/commands/upload_unittest.py:
        * Scripts/webkitpy/tool/steps/abstractstep.py:
        * Scripts/webkitpy/tool/steps/checkstyle.py:
        * Scripts/webkitpy/tool/steps/preparechangelog.py:
        * Scripts/webkitpy/tool/steps/preparechangelogfordepsroll.py:
        * Scripts/webkitpy/tool/steps/preparechangelogforrevert.py:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@82771 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/common/config/ports.py
Tools/Scripts/webkitpy/tool/commands/download_unittest.py
Tools/Scripts/webkitpy/tool/commands/roll_unittest.py
Tools/Scripts/webkitpy/tool/commands/upload_unittest.py
Tools/Scripts/webkitpy/tool/steps/abstractstep.py
Tools/Scripts/webkitpy/tool/steps/checkstyle.py
Tools/Scripts/webkitpy/tool/steps/preparechangelog.py
Tools/Scripts/webkitpy/tool/steps/preparechangelogfordepsroll.py
Tools/Scripts/webkitpy/tool/steps/preparechangelogforrevert.py

index 6891edb..306cc71 100644 (file)
@@ -2,6 +2,25 @@
 
         Reviewed by Eric Seidel.
 
+        Remove AbstractStep._run_script and move script names to ports.py
+        https://bugs.webkit.org/show_bug.cgi?id=57704
+
+        Replace deprecated _run_script with _tool.executive.run_and_throw_if_fail.
+
+        * Scripts/webkitpy/common/config/ports.py:
+        * Scripts/webkitpy/tool/commands/download_unittest.py:
+        * Scripts/webkitpy/tool/commands/roll_unittest.py:
+        * Scripts/webkitpy/tool/commands/upload_unittest.py:
+        * Scripts/webkitpy/tool/steps/abstractstep.py:
+        * Scripts/webkitpy/tool/steps/checkstyle.py:
+        * Scripts/webkitpy/tool/steps/preparechangelog.py:
+        * Scripts/webkitpy/tool/steps/preparechangelogfordepsroll.py:
+        * Scripts/webkitpy/tool/steps/preparechangelogforrevert.py:
+
+2011-04-02  Patrick Gansterer  <paroga@webkit.org>
+
+        Reviewed by Eric Seidel.
+
         Emulate shebang on Win32
         https://bugs.webkit.org/show_bug.cgi?id=55927
 
index 139d039..444a4ac 100644 (file)
@@ -90,6 +90,14 @@ class WebKitPort(object):
         return cls.script_shell_command("update-webkit")
 
     @classmethod
+    def check_webkit_style_command(cls):
+        return cls.script_shell_command("check-webkit-style")
+
+    @classmethod
+    def prepare_changelog_command(cls):
+        return cls.script_shell_command("prepare-ChangeLog")
+
+    @classmethod
     def build_webkit_command(cls, build_style=None):
         command = cls.script_shell_command("build-webkit")
         if build_style == "debug":
index ced5b2f..0a83f94 100644 (file)
@@ -123,7 +123,7 @@ class DownloadCommandsTest(CommandsTest):
         self.assert_execute_outputs(Land(), [42], options=self._default_options(), expected_stderr=expected_stderr, tool=mock_tool)
 
     def test_check_style(self):
-        expected_stderr = "Processing 1 patch from 1 bug.\nUpdating working directory\nProcessing patch 197 from bug 42.\nRunning check-webkit-style\n"
+        expected_stderr = "Processing 1 patch from 1 bug.\nUpdating working directory\nProcessing patch 197 from bug 42.\n"
         self.assert_execute_outputs(CheckStyle(), [197], options=self._default_options(), expected_stderr=expected_stderr)
 
     def test_build_attachment(self):
@@ -171,7 +171,7 @@ Not closing bug 42 as attachment 197 has review=+.  Assuming there are more patc
         self.assert_execute_outputs(LandFromBug(), [42], options=self._default_options(), expected_stderr=expected_stderr)
 
     def test_prepare_rollout(self):
-        expected_stderr = "Preparing rollout for bug 42.\nUpdating working directory\nRunning prepare-ChangeLog\n"
+        expected_stderr = "Preparing rollout for bug 42.\nUpdating working directory\n"
         self.assert_execute_outputs(PrepareRollout(), [852, "Reason"], options=self._default_options(), expected_stderr=expected_stderr)
 
     def test_create_rollout(self):
@@ -184,7 +184,6 @@ Reason
 component: MOCK component
 cc: MOCK cc
 blocked: 42
-Running prepare-ChangeLog
 MOCK add_patch_to_bug: bug_id=78, description=ROLLOUT of r852, mark_for_review=False, mark_for_commit_queue=True, mark_for_landing=False
 -- Begin comment --
 Any committer can land this patch automatically by marking it commit-queue+.  The commit-queue will build and test the patch before landing to ensure that the rollout will be successful.  This process takes approximately 15 minutes.
@@ -202,7 +201,6 @@ where ATTACHMENT_ID is the ID of this attachment.
     def test_rollout(self):
         expected_stderr = """Preparing rollout for bug 42.
 Updating working directory
-Running prepare-ChangeLog
 MOCK: user.open_url: file://...
 Was that diff correct?
 Building WebKit
index b6f69ea..da5c635 100644 (file)
@@ -36,7 +36,6 @@ class RollCommandsTest(CommandsTest):
     def test_update_chromium_deps(self):
         expected_stderr = """Updating Chromium DEPS to 6764
 MOCK: MockDEPS.write_variable(chromium_rev, 6764)
-Running prepare-ChangeLog
 MOCK: user.open_url: file://...
 Was that diff correct?
 Committed r49824: <http://trac.webkit.org/changeset/49824>
index 4313df9..4870423 100644 (file)
@@ -59,8 +59,7 @@ class UploadCommandsTest(CommandsTest):
         options.request_commit = False
         options.review = True
         options.suggest_reviewers = False
-        expected_stderr = """Running check-webkit-style
-MOCK: user.open_url: file://...
+        expected_stderr = """MOCK: user.open_url: file://...
 Was that diff correct?
 Obsoleting 2 old patches on bug 42
 MOCK add_patch_to_bug: bug_id=42, description=MOCK description, mark_for_review=True, mark_for_commit_queue=False, mark_for_landing=False
@@ -107,8 +106,7 @@ extra comment
         options.request_commit = False
         options.review = True
         options.suggest_reviewers = False
-        expected_stderr = """Running check-webkit-style
-MOCK: user.open_url: file://...
+        expected_stderr = """MOCK: user.open_url: file://...
 Was that diff correct?
 Obsoleting 2 old patches on bug 42
 MOCK add_patch_to_bug: bug_id=42, description=MOCK description, mark_for_review=True, mark_for_commit_queue=False, mark_for_landing=False
index 2ba4291..59ea36a 100644 (file)
@@ -26,7 +26,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-from webkitpy.common.system.deprecated_logging import log
 from webkitpy.common.system.executive import ScriptError
 from webkitpy.common.config.ports import WebKitPort
 from webkitpy.tool.steps.options import Options
@@ -37,14 +36,6 @@ class AbstractStep(object):
         self._tool = tool
         self._options = options
 
-    # FIXME: This should use tool.port()
-    def _run_script(self, script_name, args=None, quiet=False, port=WebKitPort):
-        log("Running %s" % script_name)
-        command = port.script_shell_command(script_name)
-        if args:
-            command.extend(args)
-        self._tool.executive.run_and_throw_if_fail(command, quiet)
-
     def _changed_files(self, state):
         return self.cached_lookup(state, "changed_files")
 
index af66c50..46c409c 100644 (file)
@@ -56,7 +56,7 @@ class CheckStyle(AbstractStep):
         args.extend(self._changed_files(state))
 
         try:
-            self._run_script("check-webkit-style", args)
+            self._tool.executive.run_and_throw_if_fail(self._tool.port().check_webkit_style_command())
         except ScriptError, e:
             if self._options.non_interactive:
                 # We need to re-raise the exception here to have the
index 4be40ca..b30dd2f 100644 (file)
@@ -61,7 +61,7 @@ class PrepareChangeLog(AbstractStep):
             self._ensure_bug_url(state)
             return
         os.chdir(self._tool.scm().checkout_root)
-        args = self._tool.port().script_shell_command("prepare-ChangeLog")
+        args = self._tool.port().prepare_changelog_command()
         if state.get("bug_id"):
             args.append("--bug=%s" % state["bug_id"])
             args.append("--description=%s" % self._tool.bugs.fetch_bug(state["bug_id"]).title())
index 39c9a9a..e636cb4 100644 (file)
@@ -34,7 +34,7 @@ from webkitpy.tool.steps.abstractstep import AbstractStep
 
 class PrepareChangeLogForDEPSRoll(AbstractStep):
     def run(self, state):
-        self._run_script("prepare-ChangeLog")
+        self._tool.executive.run_and_throw_if_fail(self._tool.port().prepare_changelog_command())
         changelog_paths = self._tool.checkout().modified_changelogs(git_commit=None)
         for changelog_path in changelog_paths:
             ChangeLog(changelog_path).update_with_unreviewed_message("Rolled DEPS.\n\n")
index dcd4b93..0a47573 100644 (file)
@@ -50,7 +50,7 @@ class PrepareChangeLogForRevert(AbstractStep):
 
     def run(self, state):
         # This could move to prepare-ChangeLog by adding a --revert= option.
-        self._run_script("prepare-ChangeLog")
+        self._tool.executive.run_and_throw_if_fail(self._tool.port().prepare_changelog_command())
         changelog_paths = self._tool.checkout().modified_changelogs(git_commit=None)
         bug_url = self._tool.bugs.bug_url_for_bug_id(state["bug_id"]) if state["bug_id"] else None
         message = self._message_for_revert(state["revision_list"], state["reason"], bug_url)