[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.21-584-g1e41756

eric at webkit.org eric at webkit.org
Fri Feb 26 22:25:55 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 7ae42c924fadfd48a2409d05470d3798ba089fdd
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Feb 19 23:07:02 2010 +0000

    2010-02-19  Eric Seidel  <eric at webkit.org>
    
            Reviewed by Adam Barth.
    
            Split out "prepare-rollout" from "rollout" and make --complete-rollout default
            https://bugs.webkit.org/show_bug.cgi?id=33745
    
            * Scripts/webkitpy/commands/download.py:
             - Add a new AbstractRolloutPrepCommand to share code between PrepareRollout and Rollout
             - Add PrepareRollout
            * Scripts/webkitpy/commands/download_unittest.py: Test PrepareRollout, remove CompleteRollout tests.
            * Scripts/webkitpy/steps/__init__.py: include ReopenBugAfterRollout step.
            * Scripts/webkitpy/steps/completerollout.py: Removed.
            * Scripts/webkitpy/steps/options.py: remove complete_rollout
            * Scripts/webkitpy/steps/reopenbugafterrollout.py: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55034 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 6a4b7b3..0fb5cbc 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,19 @@
+2010-02-19  Eric Seidel  <eric at webkit.org>
+
+        Reviewed by Adam Barth.
+
+        Split out "prepare-rollout" from "rollout" and make --complete-rollout default
+        https://bugs.webkit.org/show_bug.cgi?id=33745
+
+        * Scripts/webkitpy/commands/download.py:
+         - Add a new AbstractRolloutPrepCommand to share code between PrepareRollout and Rollout
+         - Add PrepareRollout
+        * Scripts/webkitpy/commands/download_unittest.py: Test PrepareRollout, remove CompleteRollout tests.
+        * Scripts/webkitpy/steps/__init__.py: include ReopenBugAfterRollout step.
+        * Scripts/webkitpy/steps/completerollout.py: Removed.
+        * Scripts/webkitpy/steps/options.py: remove complete_rollout
+        * Scripts/webkitpy/steps/reopenbugafterrollout.py: Added.
+
 2010-02-19  Jesus Sanchez-Palencia  <jesus.palencia at openbossa.org>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebKitTools/Scripts/webkitpy/commands/download.py b/WebKitTools/Scripts/webkitpy/commands/download.py
index 49a6862..aa423cf 100644
--- a/WebKitTools/Scripts/webkitpy/commands/download.py
+++ b/WebKitTools/Scripts/webkitpy/commands/download.py
@@ -240,11 +240,50 @@ class LandFromBug(AbstractPatchLandingCommand, ProcessBugsMixin):
     show_in_main_help = True
 
 
-class Rollout(AbstractSequencedCommand):
+class AbstractRolloutPrepCommand(AbstractSequencedCommand):
+    argument_names = "REVISION REASON"
+
+    def _parse_bug_id_from_revision_diff(self, revision):
+        original_diff = self.tool.scm().diff_for_revision(revision)
+        return parse_bug_id(original_diff)
+
+    def _bug_id_for_revision(self, revision):
+        raise NotImplementedError("subclasses must implement")
+
+    def _prepare_state(self, options, args, tool):
+        revision = args[0]
+        return {
+            "revision" : revision,
+            "bug_id" : self._bug_id_for_revision(revision),
+            "reason" : args[1],
+        }
+
+
+class PrepareRollout(AbstractRolloutPrepCommand):
+    name = "prepare-rollout"
+    help_text = "Revert the given revision in the working copy and prepare ChangeLogs with revert reason"
+    long_help = """Updates the working copy.
+Applies the inverse diff for the provided revision.
+Creates an appropriate rollout ChangeLog, including a trac link and bug link.
+"""
+    steps = [
+        steps.CleanWorkingDirectory,
+        steps.Update,
+        steps.RevertRevision,
+        steps.PrepareChangeLogForRevert,
+    ]
+
+    def _bug_id_for_revision(self, revision):
+        bug_id = self._parse_bug_id_from_revision_diff(revision)
+        if bug_id:
+            return bug_id
+        log("Failed to parse bug number from diff.")
+
+
+class Rollout(AbstractRolloutPrepCommand):
     name = "rollout"
     show_in_main_help = True
     help_text = "Revert the given revision in the working copy and optionally commit the revert and re-open the original bug"
-    argument_names = "REVISION REASON"
     long_help = """Updates the working copy.
 Applies the inverse diff for the provided revision.
 Creates an appropriate rollout ChangeLog, including a trac link and bug link.
@@ -258,27 +297,14 @@ Commits the revert and updates the bug (including re-opening the bug if necessar
         steps.PrepareChangeLogForRevert,
         steps.EditChangeLog,
         steps.ConfirmDiff,
-        steps.CompleteRollout,
+        steps.Build,
+        steps.Commit,
+        steps.ReopenBugAfterRollout,
     ]
 
-    @staticmethod
-    def _parse_bug_id_from_revision_diff(tool, revision):
-        original_diff = tool.scm().diff_for_revision(revision)
-        return parse_bug_id(original_diff)
-
-    def execute(self, options, args, tool):
-        revision = args[0]
-        reason = args[1]
-        bug_id = self._parse_bug_id_from_revision_diff(tool, revision)
-        if options.complete_rollout:
-            if bug_id:
-                log("Will re-open bug %s after rollout." % bug_id)
-            else:
-                log("Failed to parse bug number from diff.  No bugs will be updated/reopened after the rollout.")
-
-        state = {
-            "revision" : revision,
-            "bug_id" : bug_id,
-            "reason" : reason,
-        }
-        self._sequence.run_and_handle_errors(tool, options, state)
+    def _bug_id_for_revision(self, revision):
+        bug_id = self._parse_bug_id_from_revision_diff(revision)
+        if bug_id:
+            log("Will re-open bug %s after rollout." % bug_id)
+            return bug_id
+        log("Failed to parse bug number from diff.  No bugs will be updated/reopened after the rollout.")
diff --git a/WebKitTools/Scripts/webkitpy/commands/download_unittest.py b/WebKitTools/Scripts/webkitpy/commands/download_unittest.py
index f60c5b8..4f29d6f 100644
--- a/WebKitTools/Scripts/webkitpy/commands/download_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/commands/download_unittest.py
@@ -42,7 +42,6 @@ class DownloadCommandsTest(CommandsTest):
         options.build = True
         options.test = True
         options.close_bug = True
-        options.complete_rollout = False
         return options
 
     def test_build(self):
@@ -116,12 +115,11 @@ 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="Updating working directory\nRunning prepare-ChangeLog\n"
+        self.assert_execute_outputs(PrepareRollout(), [852, "Reason"], options=self._default_options(), expected_stderr=expected_stderr)
+
     def test_rollout(self):
-        expected_stderr = "Updating working directory\nRunning prepare-ChangeLog\n\nNOTE: Rollout support is experimental.\nPlease verify the rollout diff and use \"webkit-patch land 12345\" to commit the rollout.\n"
+        expected_stderr = "Will re-open bug 12345 after rollout.\nUpdating working directory\nRunning prepare-ChangeLog\nBuilding WebKit\n"
         self.assert_execute_outputs(Rollout(), [852, "Reason"], options=self._default_options(), expected_stderr=expected_stderr)
 
-    def test_complete_rollout(self):
-        options = self._default_options()
-        options.complete_rollout = True
-        expected_stderr = "Will re-open bug 12345 after rollout.\nUpdating working directory\nRunning prepare-ChangeLog\nBuilding WebKit\n"
-        self.assert_execute_outputs(Rollout(), [852, "Reason"], options=options, expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/steps/__init__.py b/WebKitTools/Scripts/webkitpy/steps/__init__.py
index 5ae4bea..9b77f4f 100644
--- a/WebKitTools/Scripts/webkitpy/steps/__init__.py
+++ b/WebKitTools/Scripts/webkitpy/steps/__init__.py
@@ -37,7 +37,6 @@ from webkitpy.steps.closebug import CloseBug
 from webkitpy.steps.closebugforlanddiff import CloseBugForLandDiff
 from webkitpy.steps.closepatch import ClosePatch
 from webkitpy.steps.commit import Commit
-from webkitpy.steps.completerollout import CompleteRollout
 from webkitpy.steps.confirmdiff import ConfirmDiff
 from webkitpy.steps.createbug import CreateBug
 from webkitpy.steps.editchangelog import EditChangeLog
@@ -50,6 +49,7 @@ from webkitpy.steps.postdiffforcommit import PostDiffForCommit
 from webkitpy.steps.preparechangelogforrevert import PrepareChangeLogForRevert
 from webkitpy.steps.preparechangelog import PrepareChangeLog
 from webkitpy.steps.promptforbugortitle import PromptForBugOrTitle
+from webkitpy.steps.reopenbugafterrollout import ReopenBugAfterRollout
 from webkitpy.steps.revertrevision import RevertRevision
 from webkitpy.steps.runtests import RunTests
 from webkitpy.steps.updatechangelogswithreviewer import UpdateChangeLogsWithReviewer
diff --git a/WebKitTools/Scripts/webkitpy/steps/completerollout.py b/WebKitTools/Scripts/webkitpy/steps/completerollout.py
deleted file mode 100644
index 8534956..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/completerollout.py
+++ /dev/null
@@ -1,66 +0,0 @@
-# Copyright (C) 2010 Google 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
-# "AS IS" 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.
-
-from webkitpy.comments import bug_comment_from_commit_text
-from webkitpy.steps.build import Build
-from webkitpy.steps.commit import Commit
-from webkitpy.steps.metastep import MetaStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import log
-
-
-class CompleteRollout(MetaStep):
-    substeps = [
-        Build,
-        Commit,
-    ]
-
-    @classmethod
-    def options(cls):
-        collected_options = cls._collect_options_from_steps(cls.substeps)
-        collected_options.append(Options.complete_rollout)
-        return collected_options
-
-    def run(self, state):
-        bug_id = state["bug_id"]
-        # FIXME: Fully automated rollout is not 100% idiot-proof yet, so for now just log with instructions on how to complete the rollout.
-        # Once we trust rollout we will remove this option.
-        if not self._options.complete_rollout:
-            log("\nNOTE: Rollout support is experimental.\nPlease verify the rollout diff and use \"webkit-patch land %s\" to commit the rollout." % bug_id)
-            return
-
-        MetaStep.run(self, state)
-
-        commit_comment = bug_comment_from_commit_text(self._tool.scm(), state["commit_text"])
-        comment_text = "Reverted r%s for reason:\n\n%s\n\n%s" % (state["revision"], state["reason"], commit_comment)
-
-        if not bug_id:
-            log(comment_text)
-            log("No bugs were updated.")
-            return
-        self._tool.bugs.reopen_bug(bug_id, comment_text)
diff --git a/WebKitTools/Scripts/webkitpy/steps/options.py b/WebKitTools/Scripts/webkitpy/steps/options.py
index 8b28f27..ea43d6d 100644
--- a/WebKitTools/Scripts/webkitpy/steps/options.py
+++ b/WebKitTools/Scripts/webkitpy/steps/options.py
@@ -36,7 +36,6 @@ class Options(object):
     check_style = make_option("--ignore-style", action="store_false", dest="check_style", default=True, help="Don't check to see if the patch has proper style before uploading.")
     clean = make_option("--no-clean", action="store_false", dest="clean", default=True, help="Don't check if the working directory is clean before applying patches")
     close_bug = make_option("--no-close", action="store_false", dest="close_bug", default=True, help="Leave bug open after landing.")
-    complete_rollout = make_option("--complete-rollout", action="store_true", dest="complete_rollout", help="Commit the revert and re-open the original bug.")
     component = make_option("--component", action="store", type="string", dest="component", help="Component for the new bug.")
     confirm = make_option("--no-confirm", action="store_false", dest="confirm", default=True, help="Skip confirmation steps.")
     description = make_option("-m", "--description", action="store", type="string", dest="description", help="Description string for the attachment (default: \"patch\")")
diff --git a/WebKitTools/Scripts/webkitpy/steps/reopenbugafterrollout.py b/WebKitTools/Scripts/webkitpy/steps/reopenbugafterrollout.py
new file mode 100644
index 0000000..6c63cfe
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/steps/reopenbugafterrollout.py
@@ -0,0 +1,44 @@
+# Copyright (C) 2010 Google 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
+# "AS IS" 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.
+
+from webkitpy.comments import bug_comment_from_commit_text
+from webkitpy.steps.abstractstep import AbstractStep
+from webkitpy.webkit_logging import log
+
+
+class ReopenBugAfterRollout(AbstractStep):
+    def run(self, state):
+        commit_comment = bug_comment_from_commit_text(self._tool.scm(), state["commit_text"])
+        comment_text = "Reverted r%s for reason:\n\n%s\n\n%s" % (state["revision"], state["reason"], commit_comment)
+
+        bug_id = state["bug_id"]
+        if not bug_id:
+            log(comment_text)
+            log("No bugs were updated.")
+            return
+        self._tool.bugs.reopen_bug(bug_id, comment_text)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list