From 004ebd05a2ce82dd6b92e9787c4241c212e7593e Mon Sep 17 00:00:00 2001 From: "eric@webkit.org" Date: Sat, 21 Nov 2009 15:50:16 +0000 Subject: [PATCH] 2009-11-21 Eric Seidel Reviewed by Adam Barth. commit-queue fails to run with "permissions error" due to bad bugzilla-tool path https://bugs.webkit.org/show_bug.cgi?id=31767 What we really want to test is BugzillaTool.path() instead of TrivialTool.path(). Since we don't have a good way to test BugzillaTool pieces, I've left out a test for now. * Scripts/bugzilla-tool: - Add a path() implementation to expose bugzilla-tool's __file__ path to commit-queue. * Scripts/modules/commands/queues.py: - Use tool.path() instead of __file__. * Scripts/modules/multicommandtool.py: - Add a new path() method to MultiComandTool. * Scripts/modules/multicommandtool_unittest.py: - Provide a path() method. Little point in testing this mock implementation. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@51283 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- WebKitTools/ChangeLog | 20 +++++++++++++++++++ WebKitTools/Scripts/bugzilla-tool | 3 +++ .../Scripts/modules/commands/queues.py | 6 ++---- .../Scripts/modules/multicommandtool.py | 4 +++- .../modules/multicommandtool_unittest.py | 3 +++ 5 files changed, 31 insertions(+), 5 deletions(-) diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog index 5391bb36009a..c897371e4244 100644 --- a/WebKitTools/ChangeLog +++ b/WebKitTools/ChangeLog @@ -1,3 +1,23 @@ +2009-11-21 Eric Seidel + + Reviewed by Adam Barth. + + commit-queue fails to run with "permissions error" due to bad bugzilla-tool path + https://bugs.webkit.org/show_bug.cgi?id=31767 + + What we really want to test is BugzillaTool.path() instead of TrivialTool.path(). + Since we don't have a good way to test BugzillaTool pieces, I've + left out a test for now. + + * Scripts/bugzilla-tool: + - Add a path() implementation to expose bugzilla-tool's __file__ path to commit-queue. + * Scripts/modules/commands/queues.py: + - Use tool.path() instead of __file__. + * Scripts/modules/multicommandtool.py: + - Add a new path() method to MultiComandTool. + * Scripts/modules/multicommandtool_unittest.py: + - Provide a path() method. Little point in testing this mock implementation. + 2009-11-21 Adam Barth Unreviewed "build" fix. Turns out I was testing the wrong copy of diff --git a/WebKitTools/Scripts/bugzilla-tool b/WebKitTools/Scripts/bugzilla-tool index 275e1f190ae0..3a48c5b69e43 100755 --- a/WebKitTools/Scripts/bugzilla-tool +++ b/WebKitTools/Scripts/bugzilla-tool @@ -72,6 +72,9 @@ class BugzillaTool(MultiCommandTool): return self.cached_scm + def path(self): + return __file__ + def should_show_command_help(self, command): if command.requires_local_commits: return self.scm().supports_local_commits() diff --git a/WebKitTools/Scripts/modules/commands/queues.py b/WebKitTools/Scripts/modules/commands/queues.py index 23fc07dacd01..fee7f6d7aad8 100644 --- a/WebKitTools/Scripts/modules/commands/queues.py +++ b/WebKitTools/Scripts/modules/commands/queues.py @@ -94,10 +94,8 @@ class AbstractQueue(Command, WorkQueueDelegate): def handle_unexpected_error(self, work_item, message): raise NotImplementedError, "subclasses must implement" - @staticmethod - def run_bugzilla_tool(args): - bugzilla_tool_path = __file__ # re-execute this script - bugzilla_tool_args = [bugzilla_tool_path] + args + def run_bugzilla_tool(self, args): + bugzilla_tool_args = [tool.path()] + args WebKitLandingScripts.run_and_throw_if_fail(bugzilla_tool_args) def log_progress(self, patch_ids): diff --git a/WebKitTools/Scripts/modules/multicommandtool.py b/WebKitTools/Scripts/modules/multicommandtool.py index fe3c2d4f8ef9..90148b28cb46 100644 --- a/WebKitTools/Scripts/modules/multicommandtool.py +++ b/WebKitTools/Scripts/modules/multicommandtool.py @@ -154,13 +154,15 @@ class MultiCommandTool(object): return command return None + def path(self): + raise NotImplementedError, "subclasses must implement" + def should_show_command_help(self, command): raise NotImplementedError, "subclasses must implement" def should_execute_command(self, command): raise NotImplementedError, "subclasses must implement" - def main(self, argv=sys.argv): (global_args, command_name, args_after_command_name) = self._split_args(argv[1:]) diff --git a/WebKitTools/Scripts/modules/multicommandtool_unittest.py b/WebKitTools/Scripts/modules/multicommandtool_unittest.py index 33cfdf2abf24..dbae909fe337 100644 --- a/WebKitTools/Scripts/modules/multicommandtool_unittest.py +++ b/WebKitTools/Scripts/modules/multicommandtool_unittest.py @@ -55,6 +55,9 @@ class TrivialTool(MultiCommandTool): def __init__(self, commands=None): MultiCommandTool.__init__(self, commands) + def path(): + return __file__ + def should_show_command_help(self, command): return True -- 2.36.0