[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

abarth at webkit.org abarth at webkit.org
Thu Apr 8 01:01:25 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit a1ebc16bfb3f72d5becfd0d4725079296103c257
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 12 09:40:54 2010 +0000

    2010-01-12  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            Add experimental "land-safely" command to webkit-patch
            https://bugs.webkit.org/show_bug.cgi?id=33518
    
            * Scripts/webkitpy/commands/upload.py:
            * Scripts/webkitpy/commands/upload_unittest.py:
            * Scripts/webkitpy/steps/__init__.py:
            * Scripts/webkitpy/steps/postdiffforcommit.py: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53120 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 7e924c2..b5331d9 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,15 @@
+2010-01-12  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        Add experimental "land-safely" command to webkit-patch
+        https://bugs.webkit.org/show_bug.cgi?id=33518
+
+        * Scripts/webkitpy/commands/upload.py:
+        * Scripts/webkitpy/commands/upload_unittest.py:
+        * Scripts/webkitpy/steps/__init__.py:
+        * Scripts/webkitpy/steps/postdiffforcommit.py: Added.
+
 2010-01-11  Kevin Ollivier  <kevino at theolliviers.com>
 
         [wx] Build fix after introduction of JS_NO_EXPORT
diff --git a/WebKitTools/Scripts/webkitpy/commands/upload.py b/WebKitTools/Scripts/webkitpy/commands/upload.py
index 65f6b39..58f5899 100644
--- a/WebKitTools/Scripts/webkitpy/commands/upload.py
+++ b/WebKitTools/Scripts/webkitpy/commands/upload.py
@@ -108,6 +108,13 @@ class AbstractPatchUploadingCommand(AbstractSequencedCommand):
             bug_id = parse_bug_id(state["diff"])
         return bug_id
 
+    def _prepare_state(self, options, args, tool):
+        state = {}
+        state["bug_id"] = self._bug_id(args, tool, state)
+        if not state["bug_id"]:
+            error("No bug id passed and no bug url found in diff.")
+        return state
+
 
 class Post(AbstractPatchUploadingCommand):
     name = "post"
@@ -121,12 +128,15 @@ class Post(AbstractPatchUploadingCommand):
         steps.PostDiff,
     ]
 
-    def _prepare_state(self, options, args, tool):
-        state = {}
-        state["bug_id"] = self._bug_id(args, tool, state)
-        if not state["bug_id"]:
-            error("No bug id passed and no bug url found in diff, can't post.")
-        return state
+
+class LandSafely(AbstractPatchUploadingCommand):
+    name = "land-safely"
+    help_text = "Land the current diff via the commit-queue (Experimental)"
+    argument_names = "[BUGID]"
+    steps = [
+        steps.UpdateChangeLogsWithReviewer,
+        steps.PostDiffForCommit,
+    ]
 
 
 class Prepare(AbstractSequencedCommand):
diff --git a/WebKitTools/Scripts/webkitpy/commands/upload_unittest.py b/WebKitTools/Scripts/webkitpy/commands/upload_unittest.py
index 4160aed..746a61a 100644
--- a/WebKitTools/Scripts/webkitpy/commands/upload_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/commands/upload_unittest.py
@@ -56,6 +56,9 @@ class UploadCommandsTest(CommandsTest):
         expected_stderr = "Running check-webkit-style\nObsoleting 2 old patches on bug 42\n"
         self.assert_execute_outputs(Post(), [42], expected_stderr=expected_stderr)
 
+    def test_post(self):
+        self.assert_execute_outputs(LandSafely(), [42])
+
     def test_prepare_diff_with_arg(self):
         self.assert_execute_outputs(Prepare(), [42])
 
diff --git a/WebKitTools/Scripts/webkitpy/steps/__init__.py b/WebKitTools/Scripts/webkitpy/steps/__init__.py
index 2ca0537..5ae4bea 100644
--- a/WebKitTools/Scripts/webkitpy/steps/__init__.py
+++ b/WebKitTools/Scripts/webkitpy/steps/__init__.py
@@ -46,6 +46,7 @@ from webkitpy.steps.ensurelocalcommitifneeded import EnsureLocalCommitIfNeeded
 from webkitpy.steps.obsoletepatches import ObsoletePatches
 from webkitpy.steps.options import Options
 from webkitpy.steps.postdiff import PostDiff
+from webkitpy.steps.postdiffforcommit import PostDiffForCommit
 from webkitpy.steps.preparechangelogforrevert import PrepareChangeLogForRevert
 from webkitpy.steps.preparechangelog import PrepareChangeLog
 from webkitpy.steps.promptforbugortitle import PromptForBugOrTitle
diff --git a/WebKitTools/Scripts/webkitpy/steps/postdiffforcommit.py b/WebKitTools/Scripts/webkitpy/steps/postdiffforcommit.py
new file mode 100644
index 0000000..daabc08
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/steps/postdiffforcommit.py
@@ -0,0 +1,41 @@
+# 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.
+
+import StringIO
+
+from webkitpy.steps.abstractstep import AbstractStep
+
+
+class PostDiffForCommit(AbstractStep):
+    def run(self, state):
+        self._tool.bugs.add_patch_to_bug(
+            state["bug_id"],
+            StringIO.StringIO(self.cached_lookup(state, "diff")),
+            "Patch for landing",
+            mark_for_review=False,
+            mark_for_commit_queue=True)
diff --git a/WebKitTools/Scripts/webkitpy/steps/updatechangelogswithreviewer.py b/WebKitTools/Scripts/webkitpy/steps/updatechangelogswithreviewer.py
index 60df204..fcb57e1 100644
--- a/WebKitTools/Scripts/webkitpy/steps/updatechangelogswithreviewer.py
+++ b/WebKitTools/Scripts/webkitpy/steps/updatechangelogswithreviewer.py
@@ -52,7 +52,7 @@ class UpdateChangeLogsWithReviewer(AbstractStep):
         return reviewer
 
     def run(self, state):
-        bug_id = state["patch"]["bug_id"]
+        bug_id = state.get("bug_id") or state["patch"]["bug_id"]
         reviewer = self._options.reviewer
         if not reviewer:
             if not bug_id:

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list