Bug 29764 - mark-bug-fixed: add -o|--open switch
Summary: mark-bug-fixed: add -o|--open switch
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-26 05:35 PDT by David Kilzer (:ddkilzer)
Modified: 2009-09-26 16:17 PDT (History)
2 users (show)

See Also:


Attachments
Patch v1 (5.18 KB, patch)
2009-09-26 05:35 PDT, David Kilzer (:ddkilzer)
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2009-09-26 05:35:48 PDT
Created attachment 40169 [details]
Patch v1

Reviewed by NOBODY (OOPS!).

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.
---
 3 files changed, 51 insertions(+), 6 deletions(-)
Comment 1 Eric Seidel (no email) 2009-09-26 11:14:59 PDT
Comment on attachment 40169 [details]
Patch v1

I like the feature!  But it's sad that it seems more of this should be in the modules and thus shared between commands.

_prompt_user_for_correctness seems useful in logging.py.

_open_bug_in_web_browser I'm not sure.  Maybe bugzilla?  or some new desktop.py or interaction.py?  I do wonder if other modules (like post-diff for instance) would want to have this option.  This is one of the sad things about splitting commands into separate scripts like this is that we have to be careful not to end up with too much code duplication.

I'm glad to see this script becoming more useful for Apple though. :)
Comment 2 David Kilzer (:ddkilzer) 2009-09-26 16:14:58 PDT
Committed r48794: <http://trac.webkit.org/changeset/48794>
Comment 3 David Kilzer (:ddkilzer) 2009-09-26 16:17:08 PDT
(In reply to comment #1)
> (From update of attachment 40169 [details])
> I like the feature!  But it's sad that it seems more of this should be in the
> modules and thus shared between commands.

It's easy enough to move the methods as soon as they're used a second time.  It seems a little premature to move a methods into modules when they're only used in one place.