[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75
ddkilzer at apple.com
ddkilzer at apple.com
Thu Oct 29 20:34:46 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit 9f9c70973d75a1bcea66eb645eee729a9f34dced
Author: ddkilzer at apple.com <ddkilzer at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Sep 26 23:14:21 2009 +0000
<http://webkit.org/b/29764> mark-bug-fixed: add -o|--open switch
Reviewed by Eric Seidel.
The -o|--open switch uses the open(1) command on Mac OS X to
open the bug URL in the default web browser. If there are
similar mechanisms on other platforms, they may be added later.
* Scripts/mark-bug-fixed:
(MarkBugFixed.__init__): Added -o|--open switch to list of parse
options.
(MarkBugFixed._determine_bug_id_and_svn_revision): Moved logging
code into main() and extracted prompting code into
_prompt_user_for_correctness().
(MarkBugFixed._open_bug_in_web_browser): Added.
(MarkBugFixed._prompt_user_for_correctness): Added.
(MarkBugFixed.main): Added logging code from
_determine_bug_id_and_svn_revision(). Added code to call
_open_bug_in_web_browser() if the switch is set. Added code to
call _prompt_user_for_correctness() when needed.
* Scripts/modules/bugzilla.py:
(Bugzilla.short_bug_url_for_bug_id): Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48794 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 61e5b0a..df39b25 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,5 +1,30 @@
2009-09-26 David Kilzer <ddkilzer at apple.com>
+ <http://webkit.org/b/29764> mark-bug-fixed: add -o|--open switch
+
+ Reviewed by Eric Seidel.
+
+ The -o|--open switch uses the open(1) command on Mac OS X to
+ open the bug URL in the default web browser. If there are
+ similar mechanisms on other platforms, they may be added later.
+
+ * Scripts/mark-bug-fixed:
+ (MarkBugFixed.__init__): Added -o|--open switch to list of parse
+ options.
+ (MarkBugFixed._determine_bug_id_and_svn_revision): Moved logging
+ code into main() and extracted prompting code into
+ _prompt_user_for_correctness().
+ (MarkBugFixed._open_bug_in_web_browser): Added.
+ (MarkBugFixed._prompt_user_for_correctness): Added.
+ (MarkBugFixed.main): Added logging code from
+ _determine_bug_id_and_svn_revision(). Added code to call
+ _open_bug_in_web_browser() if the switch is set. Added code to
+ call _prompt_user_for_correctness() when needed.
+ * Scripts/modules/bugzilla.py:
+ (Bugzilla.short_bug_url_for_bug_id): Added.
+
+2009-09-26 David Kilzer <ddkilzer at apple.com>
+
svn-unapply and svn-apply don't work when used outside multiple svn working directories
<http://webkit.org/b/29744>
diff --git a/WebKitTools/Scripts/mark-bug-fixed b/WebKitTools/Scripts/mark-bug-fixed
index a9ee944..c7086c2 100755
--- a/WebKitTools/Scripts/mark-bug-fixed
+++ b/WebKitTools/Scripts/mark-bug-fixed
@@ -34,7 +34,7 @@ from optparse import OptionParser
from modules.bugzilla import Bugzilla, parse_bug_id
from modules.comments import bug_comment_from_svn_revision
from modules.logging import error, log
-from modules.scm import detect_scm_system
+from modules.scm import SCM, detect_scm_system
class MarkBugFixedTool:
@@ -44,6 +44,7 @@ class MarkBugFixedTool:
self.option_parser = OptionParser(usage="usage: %prog [options] [rNNNNN]")
self.option_parser.add_option("-b", "--bug-id", action="store", type="string", dest="bug_id", help="Specify bug id if no URL is provided in the commit log.")
self.option_parser.add_option("-m", "--comment", action="store", type="string", dest="comment", help="Text to include in bug comment.")
+ self.option_parser.add_option("-o", "--open", action="store_true", default=False, dest="open_bug", help="Open bug in default web browser (Mac only).")
self.option_parser.add_option("-u", "--update-only", action="store_true", default=False, dest="update_only", help="Add comment to the bug, but do not close it.")
def scm(self):
@@ -78,14 +79,19 @@ class MarkBugFixedTool:
error("Could not find %s on command-line or in %s."
% (" or ".join(not_found), "r%s" % svn_revision if svn_revision else "last commit"))
- log("Bug: <http://webkit.org/b/%s> %s" % (bug_id, self.bugs.fetch_title_from_bug(bug_id)))
- log("Revision: %s" % svn_revision)
+ return (bug_id, svn_revision)
+
+ def _open_bug_in_web_browser(self, bug_id):
+ if sys.platform == "darwin":
+ SCM.run_command(["open", self.bugs.short_bug_url_for_bug_id(bug_id)])
+ return
+ log("WARNING: -o|--open is only supported on Mac OS X.")
+
+ def _prompt_user_for_correctness(self, bug_id, svn_revision):
answer = raw_input("Is this correct (y/N)? ")
if not re.match("^\s*y(es)?", answer, re.IGNORECASE):
exit(1)
- return (bug_id, svn_revision)
-
def main(self):
(options, args) = self.option_parser.parse_args(sys.argv[1:])
@@ -101,9 +107,20 @@ class MarkBugFixedTool:
if not re.match("^[0-9]+$", svn_revision):
error("Invalid svn revision: '%s'" % svn_revision)
+ needs_prompt = False
if not bug_id or not svn_revision:
+ needs_prompt = True
(bug_id, svn_revision) = self._determine_bug_id_and_svn_revision(bug_id, svn_revision)
+ log("Bug: <%s> %s" % (self.bugs.short_bug_url_for_bug_id(bug_id), self.bugs.fetch_title_from_bug(bug_id)))
+ log("Revision: %s" % svn_revision)
+
+ if options.open_bug:
+ self._open_bug_in_web_browser(bug_id)
+
+ if needs_prompt:
+ self._prompt_user_for_correctness(bug_id, svn_revision)
+
bug_comment = bug_comment_from_svn_revision(svn_revision)
if options.comment:
bug_comment = "%s\n\n%s" % (options.comment, bug_comment)
diff --git a/WebKitTools/Scripts/modules/bugzilla.py b/WebKitTools/Scripts/modules/bugzilla.py
index 3a4d00a..daf3f19 100644
--- a/WebKitTools/Scripts/modules/bugzilla.py
+++ b/WebKitTools/Scripts/modules/bugzilla.py
@@ -151,7 +151,10 @@ class Bugzilla:
def bug_url_for_bug_id(self, bug_id, xml=False):
content_type = "&ctype=xml" if xml else ""
return "%sshow_bug.cgi?id=%s%s" % (self.bug_server_url, bug_id, content_type)
-
+
+ def short_bug_url_for_bug_id(self, bug_id):
+ return "http://webkit.org/b/%s" % bug_id
+
def attachment_url_for_id(self, attachment_id, action="view"):
action_param = ""
if action and action != "view":
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list