Bug 28877 - Implement bugzilla-tool mark-fixed
Summary: Implement bugzilla-tool mark-fixed
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: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-01 09:42 PDT by David Kilzer (:ddkilzer)
Modified: 2009-09-01 19:17 PDT (History)
2 users (show)

See Also:


Attachments
Patch v1 (7.97 KB, patch)
2009-09-01 09:42 PDT, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff
Patch v2 (9.38 KB, patch)
2009-09-01 14:35 PDT, David Kilzer (:ddkilzer)
levin: 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-01 09:42:10 PDT
Created attachment 38867 [details]
Patch v1

Reviewed by NOBODY (OOPS!).

The mark-fixed subcommand is for those times when you don't use
bugzilla-tool to commit a patch, but you want to use it to close
the bug with a committed-revision message.

* Scripts/bugzilla-tool:
(bug_comment_from_svn_revision): Added.  Extracted from
bug_comment_from_commit_text().
(bug_comment_from_commit_text): Extracted
bug_comment_from_svn_revision() from this method.
(MarkBugFixed.__init__): Added.
(MarkBugFixed._determine_bug_id_and_svn_revision): Added.
Attempts to use bug id and svn revision passed in from the
command-line, but falls back to checking the last svn commit log
if either isn't defined.
(MarkBugFixed.execute): Added.  Adds a comment about the
revision that fixed the bug and closes the bug.
(BugzillaTool.__init__): Added mark-fixed subcommand.
* Scripts/modules/bugzilla.py:
(Bugzilla.fetch_title_from_bug): Added.
* Scripts/modules/scm.py:
(SCM.last_svn_commit_log): Added.  Subclasses must override.
(SVN.last_svn_commit_log): Added.  Uses svnversion to find the
last commit in an svn working directory and then runs svn log.
(Git.last_svn_commit_log): Added.  Runs git-svn-log with a limit
of one log message.
---
 4 files changed, 115 insertions(+), 2 deletions(-)
Comment 1 David Levin 2009-09-01 10:17:40 PDT
Comment on attachment 38867 [details]
Patch v1

> +        return self.run_command(['svn', 'log', '-r', revision])

It would be nice to add --non-interactive to avoid having this hang on a password prompt. Of course, one could argue that this should be done for all svn commands which it isn't....
Comment 2 David Kilzer (:ddkilzer) 2009-09-01 10:55:49 PDT
Comment on attachment 38867 [details]
Patch v1

Thanks for the review, David!  I realized that when you pass a revision but no bug id that it should look for the bug id in that revision, not the latest one.  I want to update the patch to fix that.
Comment 3 David Kilzer (:ddkilzer) 2009-09-01 14:35:10 PDT
Created attachment 38886 [details]
Patch v2
Comment 4 David Levin 2009-09-01 14:57:35 PDT
Comment on attachment 38886 [details]
Patch v2

It would be nice to add --non-interactive to the svn commands to avoid having this hang on a
password prompt. Of course, one could argue that this should be done for all
svn commands which it isn't....
Comment 5 David Kilzer (:ddkilzer) 2009-09-01 15:59:26 PDT
(In reply to comment #4)
> (From update of attachment 38886 [details])
> It would be nice to add --non-interactive to the svn commands to avoid having
> this hang on a
> password prompt. Of course, one could argue that this should be done for all
> svn commands which it isn't....

Oops!  Sorry, my bad. I meant to fix this from Patch v1.  Will make this change for the new commands before landing.
Comment 6 David Kilzer (:ddkilzer) 2009-09-01 16:08:18 PDT
Committed r47949: <http://trac.webkit.org/changeset/47949>
Comment 7 Eric Seidel (no email) 2009-09-01 17:23:28 PDT
I'm starting to think we shoudl split bugzilla-tool out into multiple tools.  One of which deals with bugzilla stuff, like this.  Donno.

I keep meaning to split the option parsing code out into its own file and then make it easy to break the Command subclasses up into files.  We could at least group the commands into related categories.

Related to that, I really want --help to just print a list of commands and add a "bugzilla help command_name" behavior for printing full option lists.
Comment 8 David Kilzer (:ddkilzer) 2009-09-01 19:17:41 PDT
(In reply to comment #7)
> I'm starting to think we shoudl split bugzilla-tool out into multiple tools. 
> One of which deals with bugzilla stuff, like this.  Donno.

The mark-fixed command would do well ask mark-bug-fixed, methinks.