[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

abarth at webkit.org abarth at webkit.org
Wed Dec 22 14:36:48 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 7b9036683205f99da012a4d9f97e4790a4aae397
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 14 05:04:43 2010 +0000

    2010-10-13  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            Make --port a global option and pass the port information to the commit-queue subprocess
            https://bugs.webkit.org/show_bug.cgi?id=47650
    
            This patch paves the way to run the commit-queue on a non-Mac port.
    
            * Scripts/webkitpy/tool/commands/queues.py:
            * Scripts/webkitpy/tool/commands/queues_unittest.py:
            * Scripts/webkitpy/tool/commands/queuestest.py:
            * Scripts/webkitpy/tool/main.py:
            * Scripts/webkitpy/tool/steps/options.py:
            * Scripts/webkitpy/tool/steps/preparechangelog.py:
            * Scripts/webkitpy/tool/steps/runtests.py:
            * Scripts/webkitpy/tool/steps/update.py:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69737 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 878a2cc..a2ec9ad 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -2,6 +2,24 @@
 
         Reviewed by Eric Seidel.
 
+        Make --port a global option and pass the port information to the commit-queue subprocess
+        https://bugs.webkit.org/show_bug.cgi?id=47650
+
+        This patch paves the way to run the commit-queue on a non-Mac port.
+
+        * Scripts/webkitpy/tool/commands/queues.py:
+        * Scripts/webkitpy/tool/commands/queues_unittest.py:
+        * Scripts/webkitpy/tool/commands/queuestest.py:
+        * Scripts/webkitpy/tool/main.py:
+        * Scripts/webkitpy/tool/steps/options.py:
+        * Scripts/webkitpy/tool/steps/preparechangelog.py:
+        * Scripts/webkitpy/tool/steps/runtests.py:
+        * Scripts/webkitpy/tool/steps/update.py:
+
+2010-10-13  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Eric Seidel.
+
         Introduce the ChromiumXVFBPort for running commit-queue on EC2
         https://bugs.webkit.org/show_bug.cgi?id=47653
 
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queues.py b/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
index 4fb1a7c..4e00e3e 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
@@ -80,6 +80,8 @@ class AbstractQueue(Command, QueueEngineDelegate):
         webkit_patch_args += ["--status-host=%s" % self._tool.status_server.host]
         if self._tool.status_server.bot_id:
             webkit_patch_args += ["--bot-id=%s" % self._tool.status_server.bot_id]
+        if self._options.port:
+            webkit_patch_args += ["--port=%s" % self._options.port]
         webkit_patch_args.extend(args)
         return self._tool.executive.run_and_throw_if_fail(webkit_patch_args)
 
@@ -96,7 +98,7 @@ class AbstractQueue(Command, QueueEngineDelegate):
 
     def begin_work_queue(self):
         log("CAUTION: %s will discard all local changes in \"%s\"" % (self.name, self._tool.scm().checkout_root))
-        if self.options.confirm:
+        if self._options.confirm:
             response = self._tool.user.prompt("Are you sure?  Type \"yes\" to continue: ")
             if (response != "yes"):
                 error("User declined.")
@@ -108,7 +110,7 @@ class AbstractQueue(Command, QueueEngineDelegate):
 
     def should_continue_work_queue(self):
         self._iteration_count += 1
-        return not self.options.iterations or self._iteration_count <= self.options.iterations
+        return not self._options.iterations or self._iteration_count <= self._options.iterations
 
     def next_work_item(self):
         raise NotImplementedError, "subclasses must implement"
@@ -125,7 +127,7 @@ class AbstractQueue(Command, QueueEngineDelegate):
     # Command methods
 
     def execute(self, options, args, tool, engine=QueueEngine):
-        self.options = options  # FIXME: This code is wrong.  Command.options is a list, this assumes an Options element!
+        self._options = options # FIXME: This code is wrong.  Command.options is a list, this assumes an Options element!
         self._tool = tool  # FIXME: This code is wrong too!  Command.bind_to_tool handles this!
         return engine(self.name, self, self._tool.wakeup_event).run()
 
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
index 9e99a20..d680098 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
@@ -60,25 +60,31 @@ class AbstractQueueTest(CommandsTest):
     def test_log_directory(self):
         self.assertEquals(TestQueue()._log_directory(), "test-queue-logs")
 
-    def _assert_run_webkit_patch(self, run_args):
+    def _assert_run_webkit_patch(self, run_args, port=None):
         queue = TestQueue()
         tool = MockTool()
         tool.status_server.bot_id = "gort"
         tool.executive = Mock()
         queue.bind_to_tool(tool)
+        queue._options = Mock()
+        queue._options.port = port
 
         queue.run_webkit_patch(run_args)
-        expected_run_args = ["echo", "--status-host=example.com", "--bot-id=gort"] + run_args
+        expected_run_args = ["echo", "--status-host=example.com", "--bot-id=gort"]
+        if port:
+            expected_run_args.append("--port=%s" % port)
+        expected_run_args.extend(run_args)
         tool.executive.run_and_throw_if_fail.assert_called_with(expected_run_args)
 
     def test_run_webkit_patch(self):
         self._assert_run_webkit_patch([1])
         self._assert_run_webkit_patch(["one", 2])
+        self._assert_run_webkit_patch([1], port="mockport")
 
     def test_iteration_count(self):
         queue = TestQueue()
-        queue.options = Mock()
-        queue.options.iterations = 3
+        queue._options = Mock()
+        queue._options.iterations = 3
         self.assertTrue(queue.should_continue_work_queue())
         self.assertTrue(queue.should_continue_work_queue())
         self.assertTrue(queue.should_continue_work_queue())
@@ -86,7 +92,7 @@ class AbstractQueueTest(CommandsTest):
 
     def test_no_iteration_count(self):
         queue = TestQueue()
-        queue.options = Mock()
+        queue._options = Mock()
         self.assertTrue(queue.should_continue_work_queue())
         self.assertTrue(queue.should_continue_work_queue())
         self.assertTrue(queue.should_continue_work_queue())
@@ -140,6 +146,8 @@ class AbstractPatchQueueTest(CommandsTest):
         queue = AbstractPatchQueue()
         tool = MockTool()
         queue.bind_to_tool(tool)
+        queue._options = Mock()
+        queue._options.port = None
         self.assertEquals(queue._fetch_next_work_item(), None)
         tool.status_server = MockStatusServer(work_items=[2, 1, 3])
         self.assertEquals(queue._fetch_next_work_item(), 2)
@@ -150,6 +158,8 @@ class AbstractReviewQueueTest(CommandsTest):
         queue = TestReviewQueue()
         tool = MockTool()
         queue.bind_to_tool(tool)
+        queue._options = Mock()
+        queue._options.port = None
         self.assertEquals(queue.collection_name(), "test-review-queue")
         self.assertEquals(queue.fetch_potential_patch_ids(), [103])
         queue.status_server()
@@ -291,6 +301,8 @@ MOCK: update_status: commit-queue Pass
     def test_manual_reject_during_processing(self):
         queue = SecondThoughtsCommitQueue()
         queue.bind_to_tool(MockTool())
+        queue._options = Mock()
+        queue._options.port = None
         expected_stderr = """MOCK: update_status: commit-queue Applied patch
 MOCK: update_status: commit-queue Built patch
 MOCK: update_status: commit-queue Passed tests
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queuestest.py b/WebKitTools/Scripts/webkitpy/tool/commands/queuestest.py
index 9f3583d..379d380 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/queuestest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queuestest.py
@@ -80,13 +80,18 @@ class QueuesTest(unittest.TestCase):
         string_replacements = {"name": name, 'checkout_dir': checkout_dir}
         return "CAUTION: %(name)s will discard all local changes in \"%(checkout_dir)s\"\nRunning WebKit %(name)s.\nMOCK: update_status: %(name)s Starting Queue\n" % string_replacements
 
-    def assert_queue_outputs(self, queue, args=None, work_item=None, expected_stdout=None, expected_stderr=None, expected_exceptions=None, options=Mock(), tool=MockTool()):
+    def assert_queue_outputs(self, queue, args=None, work_item=None, expected_stdout=None, expected_stderr=None, expected_exceptions=None, options=None, tool=None):
+        if not tool:
+            tool = MockTool()
         if not expected_stdout:
             expected_stdout = {}
         if not expected_stderr:
             expected_stderr = {}
         if not args:
             args = []
+        if not options:
+            options = Mock()
+            options.port = None
         if not work_item:
             work_item = self.mock_work_item
         tool.user.prompt = lambda message: "yes"
diff --git a/WebKitTools/Scripts/webkitpy/tool/main.py b/WebKitTools/Scripts/webkitpy/tool/main.py
index b47bb43..721bf59 100755
--- a/WebKitTools/Scripts/webkitpy/tool/main.py
+++ b/WebKitTools/Scripts/webkitpy/tool/main.py
@@ -62,6 +62,7 @@ class WebKitPatch(MultiCommandTool):
         make_option("--status-host", action="store", dest="status_host", type="string", help="Hostname (e.g. localhost or commit.webkit.org) where status updates should be posted."),
         make_option("--bot-id", action="store", dest="bot_id", type="string", help="Identifier for this bot (if multiple bots are running for a queue)"),
         make_option("--irc-password", action="store", dest="irc_password", type="string", help="Password to use when communicating via IRC."),
+        make_option("--port", action="store", dest="port", default=None, help="Specify a port (e.g., mac, qt, gtk, ...)."),
     ]
 
     def __init__(self, path):
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/options.py b/WebKitTools/Scripts/webkitpy/tool/steps/options.py
index 3dc1963..835fdba 100644
--- a/WebKitTools/Scripts/webkitpy/tool/steps/options.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/options.py
@@ -50,7 +50,6 @@ class Options(object):
     obsolete_patches = make_option("--no-obsolete", action="store_false", dest="obsolete_patches", default=True, help="Do not obsolete old patches before posting this one.")
     open_bug = make_option("--open-bug", action="store_true", dest="open_bug", default=False, help="Opens the associated bug in a browser.")
     parent_command = make_option("--parent-command", action="store", dest="parent_command", default=None, help="(Internal) The command that spawned this instance.")
-    port = make_option("--port", action="store", dest="port", default=None, help="Specify a port (e.g., mac, qt, gtk, ...).")
     quiet = make_option("--quiet", action="store_true", dest="quiet", default=False, help="Produce less console output.")
     request_commit = make_option("--request-commit", action="store_true", dest="request_commit", default=False, help="Mark the patch as needing auto-commit after review.")
     review = make_option("--no-review", action="store_false", dest="review", default=True, help="Do not mark the patch for review.")
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelog.py b/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelog.py
index ce04024..6a6960a 100644
--- a/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelog.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelog.py
@@ -39,7 +39,6 @@ class PrepareChangeLog(AbstractStep):
     @classmethod
     def options(cls):
         return AbstractStep.options() + [
-            Options.port,
             Options.quiet,
             Options.email,
             Options.git_commit,
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/runtests.py b/WebKitTools/Scripts/webkitpy/tool/steps/runtests.py
index aff1fd9..89ef694 100644
--- a/WebKitTools/Scripts/webkitpy/tool/steps/runtests.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/runtests.py
@@ -37,7 +37,6 @@ class RunTests(AbstractStep):
             Options.test,
             Options.non_interactive,
             Options.quiet,
-            Options.port,
         ]
 
     def run(self, state):
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/update.py b/WebKitTools/Scripts/webkitpy/tool/steps/update.py
index 0f450f3..8c290f9 100644
--- a/WebKitTools/Scripts/webkitpy/tool/steps/update.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/update.py
@@ -36,7 +36,6 @@ class Update(AbstractStep):
     def options(cls):
         return AbstractStep.options() + [
             Options.update,
-            Options.port,
         ]
 
     def run(self, state):

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list