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

abarth at webkit.org abarth at webkit.org
Wed Apr 7 23:59:12 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 97bc93f4ce10298ed3a9ce29295c2c6e57453935
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Nov 28 18:27:29 2009 +0000

    2009-11-28  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            [bzt] style-queue shouldn't reject patches from the commit-queue
            https://bugs.webkit.org/show_bug.cgi?id=31944
    
            Currently the style-queue subprocess gets confused and thinks its the
            commit-queue.  If the patch has an error, it rejects it from the
            commit-queue.  Instead, we should have style-queue specific logic.
            This patch doesn't add that logic, but it gives us a callback we can
            use to add that logic.
    
            * Scripts/modules/buildsteps.py:
            * Scripts/modules/commands/queues.py:
            * Scripts/modules/landingsequence.py:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51460 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 90ae03a..3552a89 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,20 @@
+2009-11-28  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        [bzt] style-queue shouldn't reject patches from the commit-queue
+        https://bugs.webkit.org/show_bug.cgi?id=31944
+
+        Currently the style-queue subprocess gets confused and thinks its the
+        commit-queue.  If the patch has an error, it rejects it from the
+        commit-queue.  Instead, we should have style-queue specific logic.
+        This patch doesn't add that logic, but it gives us a callback we can
+        use to add that logic.
+
+        * Scripts/modules/buildsteps.py:
+        * Scripts/modules/commands/queues.py:
+        * Scripts/modules/landingsequence.py:
+
 2009-11-27  Adam Barth  <abarth at webkit.org>
 
         Rubber stamped by Eric Seidel.
diff --git a/WebKitTools/Scripts/modules/buildsteps.py b/WebKitTools/Scripts/modules/buildsteps.py
index 5c50fbf..edde38c 100644
--- a/WebKitTools/Scripts/modules/buildsteps.py
+++ b/WebKitTools/Scripts/modules/buildsteps.py
@@ -49,6 +49,7 @@ class BuildSteps:
             make_option("--ignore-builders", action="store_false", dest="check_builders", default=True, help="Don't check to see if the build.webkit.org builders are green before landing."),
             make_option("--quiet", action="store_true", dest="quiet", default=False, help="Produce less console output."),
             make_option("--non-interactive", action="store_true", dest="non_interactive", default=False, help="Never prompt the user, fail as fast as possible."),
+            make_option("--parent-command", action="store", dest="parent_command", default=None, help="(Internal) The command that spawned this instance."),
         ] + WebKitPort.port_options()
 
     @staticmethod
diff --git a/WebKitTools/Scripts/modules/commands/queues.py b/WebKitTools/Scripts/modules/commands/queues.py
index 918397f..f054091 100644
--- a/WebKitTools/Scripts/modules/commands/queues.py
+++ b/WebKitTools/Scripts/modules/commands/queues.py
@@ -44,7 +44,7 @@ from modules.buildbot import BuildBot
 from modules.changelogs import ChangeLog
 from modules.comments import bug_comment_from_commit_text
 from modules.grammar import pluralize
-from modules.landingsequence import LandingSequence, ConditionalLandingSequence
+from modules.landingsequence import LandingSequence, ConditionalLandingSequence, LandingSequenceErrorHandler
 from modules.logging import error, log, tee
 from modules.multicommandtool import MultiCommandTool, Command
 from modules.patchcollection import PatchCollection, PersistentPatchCollection, PersistentPatchCollectionDelegate
@@ -108,12 +108,14 @@ class AbstractQueue(Command, WorkQueueDelegate):
         work_queue.run()
 
 
-class CommitQueue(AbstractQueue):
+class CommitQueue(AbstractQueue, LandingSequenceErrorHandler):
     name = "commit-queue"
     show_in_main_help = False
     def __init__(self):
         AbstractQueue.__init__(self)
 
+    # AbstractQueue methods
+
     def begin_work_queue(self):
         AbstractQueue.begin_work_queue(self)
 
@@ -133,13 +135,19 @@ class CommitQueue(AbstractQueue):
         return (True, "Landing patch %s from bug %s." % (patch["id"], patch["bug_id"]), patch)
 
     def process_work_item(self, patch):
-        self.run_bugzilla_tool(["land-attachment", "--force-clean", "--non-interactive", "--quiet", patch["id"]])
+        self.run_bugzilla_tool(["land-attachment", "--force-clean", "--non-interactive", "--parent-command=commit-queue", "--quiet", patch["id"]])
 
     def handle_unexpected_error(self, patch, message):
         self.tool.bugs.reject_patch_from_commit_queue(patch["id"], message)
 
+    # LandingSequenceErrorHandler methods
+
+    @classmethod
+    def handle_script_error(cls, tool, patch, script_error):
+        tool.bugs.reject_patch_from_commit_queue(patch["id"], script_error.message_with_output())
 
-class AbstractTryQueue(AbstractQueue, PersistentPatchCollectionDelegate):
+
+class AbstractTryQueue(AbstractQueue, PersistentPatchCollectionDelegate, LandingSequenceErrorHandler):
     def __init__(self, options=[]):
         AbstractQueue.__init__(self, options)
 
@@ -174,6 +182,12 @@ class AbstractTryQueue(AbstractQueue, PersistentPatchCollectionDelegate):
         log(message)
         self._patches.done(patch)
 
+    # LandingSequenceErrorHandler methods
+
+    @classmethod
+    def handle_script_error(cls, tool, patch, script_error):
+        log(script_error.message_with_output())
+
 
 class StyleQueue(AbstractTryQueue):
     name = "style-queue"
@@ -185,7 +199,7 @@ class StyleQueue(AbstractTryQueue):
         return (True, "Checking style for patch %s on bug %s." % (patch["id"], patch["bug_id"]), patch)
 
     def process_work_item(self, patch):
-        self.run_bugzilla_tool(["check-style", "--force-clean", "--non-interactive", patch["id"]])
+        self.run_bugzilla_tool(["check-style", "--force-clean", "--non-interactive", "--parent-command=style-queue", patch["id"]])
         self._patches.done(patch)
 
 
@@ -208,5 +222,5 @@ class BuildQueue(AbstractTryQueue):
         return (True, "Building patch %s on bug %s." % (patch["id"], patch["bug_id"]), patch)
 
     def process_work_item(self, patch):
-        self.run_bugzilla_tool(["build-attachment", self.port.flag(), "--force-clean", "--quiet", "--no-update", patch["id"]])
+        self.run_bugzilla_tool(["build-attachment", self.port.flag(), "--force-clean", "--quiet", "--non-interactive", "--parent-command=build-queue", "--no-update", patch["id"]])
         self._patches.done(patch)
diff --git a/WebKitTools/Scripts/modules/landingsequence.py b/WebKitTools/Scripts/modules/landingsequence.py
index 415dd79..7655eaa 100644
--- a/WebKitTools/Scripts/modules/landingsequence.py
+++ b/WebKitTools/Scripts/modules/landingsequence.py
@@ -34,6 +34,12 @@ from modules.scm import ScriptError, CheckoutNeedsUpdate
 from modules.webkitport import WebKitPort
 from modules.workqueue import WorkQueue
 
+class LandingSequenceErrorHandler():
+    @classmethod
+    def handle_script_error(cls, tool, patch, script_error):
+        raise NotImplementedError, "subclasses must implement"
+
+
 class LandingSequence:
     def __init__(self, patch, options, tool):
         self._patch = patch
@@ -61,9 +67,9 @@ class LandingSequence:
         except ScriptError, e:
             if not self._options.quiet:
                 log(e.message_with_output())
-            if self._options.non_interactive:
-                # Mark the patch as commit-queue- and comment in the bug.
-                self._tool.bugs.reject_patch_from_commit_queue(self._patch["id"], e.message_with_output())
+            if self._options.parent_command:
+                command = self._tool.command_by_name(self._options.parent_command)
+                command.handle_script_error(self._tool, self._patch, e)
             WorkQueue.exit_after_handled_error(e)
 
     def clean(self):

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list