Changeset 48794 in webkit
- Timestamp:
- Sep 26, 2009 4:14:21 PM (15 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r48793 r48794 1 2009-09-26 David Kilzer <ddkilzer@apple.com> 2 3 <http://webkit.org/b/29764> mark-bug-fixed: add -o|--open switch 4 5 Reviewed by Eric Seidel. 6 7 The -o|--open switch uses the open(1) command on Mac OS X to 8 open the bug URL in the default web browser. If there are 9 similar mechanisms on other platforms, they may be added later. 10 11 * Scripts/mark-bug-fixed: 12 (MarkBugFixed.__init__): Added -o|--open switch to list of parse 13 options. 14 (MarkBugFixed._determine_bug_id_and_svn_revision): Moved logging 15 code into main() and extracted prompting code into 16 _prompt_user_for_correctness(). 17 (MarkBugFixed._open_bug_in_web_browser): Added. 18 (MarkBugFixed._prompt_user_for_correctness): Added. 19 (MarkBugFixed.main): Added logging code from 20 _determine_bug_id_and_svn_revision(). Added code to call 21 _open_bug_in_web_browser() if the switch is set. Added code to 22 call _prompt_user_for_correctness() when needed. 23 * Scripts/modules/bugzilla.py: 24 (Bugzilla.short_bug_url_for_bug_id): Added. 25 1 26 2009-09-26 David Kilzer <ddkilzer@apple.com> 2 27 -
trunk/WebKitTools/Scripts/mark-bug-fixed
r48772 r48794 35 35 from modules.comments import bug_comment_from_svn_revision 36 36 from modules.logging import error, log 37 from modules.scm import detect_scm_system37 from modules.scm import SCM, detect_scm_system 38 38 39 39 … … 45 45 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.") 46 46 self.option_parser.add_option("-m", "--comment", action="store", type="string", dest="comment", help="Text to include in bug comment.") 47 self.option_parser.add_option("-o", "--open", action="store_true", default=False, dest="open_bug", help="Open bug in default web browser (Mac only).") 47 48 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.") 48 49 … … 79 80 % (" or ".join(not_found), "r%s" % svn_revision if svn_revision else "last commit")) 80 81 81 log("Bug: <http://webkit.org/b/%s> %s" % (bug_id, self.bugs.fetch_title_from_bug(bug_id))) 82 log("Revision: %s" % svn_revision) 82 return (bug_id, svn_revision) 83 84 def _open_bug_in_web_browser(self, bug_id): 85 if sys.platform == "darwin": 86 SCM.run_command(["open", self.bugs.short_bug_url_for_bug_id(bug_id)]) 87 return 88 log("WARNING: -o|--open is only supported on Mac OS X.") 89 90 def _prompt_user_for_correctness(self, bug_id, svn_revision): 83 91 answer = raw_input("Is this correct (y/N)? ") 84 92 if not re.match("^\s*y(es)?", answer, re.IGNORECASE): 85 93 exit(1) 86 87 return (bug_id, svn_revision)88 94 89 95 def main(self): … … 102 108 error("Invalid svn revision: '%s'" % svn_revision) 103 109 110 needs_prompt = False 104 111 if not bug_id or not svn_revision: 112 needs_prompt = True 105 113 (bug_id, svn_revision) = self._determine_bug_id_and_svn_revision(bug_id, svn_revision) 114 115 log("Bug: <%s> %s" % (self.bugs.short_bug_url_for_bug_id(bug_id), self.bugs.fetch_title_from_bug(bug_id))) 116 log("Revision: %s" % svn_revision) 117 118 if options.open_bug: 119 self._open_bug_in_web_browser(bug_id) 120 121 if needs_prompt: 122 self._prompt_user_for_correctness(bug_id, svn_revision) 106 123 107 124 bug_comment = bug_comment_from_svn_revision(svn_revision) -
trunk/WebKitTools/Scripts/modules/bugzilla.py
r48700 r48794 152 152 content_type = "&ctype=xml" if xml else "" 153 153 return "%sshow_bug.cgi?id=%s%s" % (self.bug_server_url, bug_id, content_type) 154 154 155 def short_bug_url_for_bug_id(self, bug_id): 156 return "http://webkit.org/b/%s" % bug_id 157 155 158 def attachment_url_for_id(self, attachment_id, action="view"): 156 159 action_param = ""
Note: See TracChangeset
for help on using the changeset viewer.