<http://webkit.org/b/29712> mark-bug-fixed: add -m|--comment switch
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Sep 2009 17:14:45 +0000 (17:14 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Sep 2009 17:14:45 +0000 (17:14 +0000)
        Reviewed by Adam Roben.

        * Scripts/mark-bug-fixed:
        (MarkBugFixed.__init__): Added -m|--comment switch to list of
        parse options.
        (MarkBugFixed.main): When specified, prepend comment from
        -m|--comment command-line switch to the bug comment.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48722 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitTools/ChangeLog
WebKitTools/Scripts/mark-bug-fixed

index 6aff252..75fec80 100644 (file)
@@ -1,3 +1,15 @@
+2009-09-24  David Kilzer  <ddkilzer@apple.com>
+
+        <http://webkit.org/b/29712> mark-bug-fixed: add -m|--comment switch
+
+        Reviewed by Adam Roben.
+
+        * Scripts/mark-bug-fixed:
+        (MarkBugFixed.__init__): Added -m|--comment switch to list of
+        parse options.
+        (MarkBugFixed.main): When specified, prepend comment from
+        -m|--comment command-line switch to the bug comment.
+
 2009-09-24  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
 
         Reviewed by Jan Alonzo.
index 6893fb6..d3c3d92 100755 (executable)
@@ -42,7 +42,8 @@ class MarkBugFixedTool:
         self.bugs = Bugzilla()
         self.cached_scm = None
         self.option_parser = OptionParser(usage="usage: %prog [options] [rNNNNN]")
-        self.option_parser.add_option("-b", "--bug-id", dest="bug_id", help="Specify bug id if no URL is provided in the commit log.")
+        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.")
 
     def scm(self):
         # Lazily initialize SCM to not error-out before command line parsing (or when running non-scm commands).
@@ -102,8 +103,12 @@ class MarkBugFixedTool:
         if not bug_id or not svn_revision:
             (bug_id, svn_revision) = self._determine_bug_id_and_svn_revision(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)
+
         log("Updating Bug %s." % bug_id)
-        self.bugs.close_bug_as_fixed(bug_id, bug_comment_from_svn_revision(svn_revision))
+        self.bugs.close_bug_as_fixed(bug_id, bug_comment)
 
 
 def main():