Changeset 50107 in webkit


Ignore:
Timestamp:
Oct 26, 2009 3:41:10 PM (14 years ago)
Author:
eric@webkit.org
Message:

2009-10-24 Eric Seidel <eric@webkit.org>

Reviewed by Adam Barth.

bugzilla-tool post-diff should know how to mark commit-queue=?
https://bugs.webkit.org/show_bug.cgi?id=29202

  • Scripts/bugzilla-tool:
    • Add --commit-queue option to post-diff, post-commits and create-bug.
  • Scripts/modules/bugzilla.py:
    • Added support for --commit-queue to add_patch_to_bug and create_bug_with_patch.
    • Added _fill_attachment_form to share code between add_patch_to_bug and create_bug_with_patch.
Location:
trunk/WebKitTools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r50105 r50107  
     12009-10-24  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        bugzilla-tool post-diff should know how to mark commit-queue=?
     6        https://bugs.webkit.org/show_bug.cgi?id=29202
     7
     8        * Scripts/bugzilla-tool:
     9         - Add --commit-queue option to post-diff, post-commits and create-bug.
     10        * Scripts/modules/bugzilla.py:
     11         - Added support for --commit-queue to add_patch_to_bug and create_bug_with_patch.
     12         - Added _fill_attachment_form to share code between add_patch_to_bug and create_bug_with_patch.
     13
    1142009-10-23  Eric Seidel  <eric@webkit.org>
    215
  • trunk/WebKitTools/Scripts/bugzilla-tool

    r50105 r50107  
    426426            make_option("--no-obsolete", action="store_false", dest="obsolete_patches", default=True, help="Do not obsolete old patches before posting this one."),
    427427            make_option("--no-review", action="store_false", dest="review", default=True, help="Do not mark the patch for review."),
     428            make_option("--request-commit", action="store_true", dest="request_commit", default=False, help="Mark the patch as needing auto-commit after review."),
    428429        ]
    429430
     
    449450
    450451        description = options.description or "Patch v1"
    451         tool.bugs.add_patch_to_bug(bug_id, diff_file, description, mark_for_review=options.review)
     452        tool.bugs.add_patch_to_bug(bug_id, diff_file, description, mark_for_review=options.review, mark_for_commit_queue=options.request_commit)
    452453
    453454
     
    499500            description = options.description or commit_message.description(lstrip=True, strip_url=True)
    500501            comment_text = self._comment_text_for_commit(options, commit_message, tool, commit_id)
    501             tool.bugs.add_patch_to_bug(bug_id, diff_file, description, comment_text, mark_for_review=options.review)
     502            tool.bugs.add_patch_to_bug(bug_id, diff_file, description, comment_text, mark_for_review=options.review, mark_for_commit_queue=options.request_commit)
    502503
    503504
     
    566567            make_option("--no-prompt", action="store_false", dest="prompt", default=True, help="Do not prompt for bug title and comment; use commit log instead."),
    567568            make_option("--no-review", action="store_false", dest="review", default=True, help="Do not mark the patch for review."),
     569            make_option("--request-commit", action="store_true", dest="request_commit", default=False, help="Mark the patch as needing auto-commit after review."),
    568570        ]
    569571        Command.__init__(self, 'Create a bug from local changes or local commits.', '[COMMITISH]', options=options)
     
    589591        diff = tool.scm().create_patch_from_local_commit(commit_id)
    590592        diff_file = StringIO.StringIO(diff) # create_bug_with_patch expects a file-like object
    591         bug_id = tool.bugs.create_bug_with_patch(bug_title, comment_text, options.component, diff_file, "Patch v1", cc=options.cc, mark_for_review=options.review)
     593        bug_id = tool.bugs.create_bug_with_patch(bug_title, comment_text, options.component, diff_file, "Patch v1", cc=options.cc, mark_for_review=options.review, mark_for_commit_queue=options.request_commit)
    592594
    593595        if bug_id and len(commit_ids) > 1:
     
    609611        diff = tool.scm().create_patch()
    610612        diff_file = StringIO.StringIO(diff) # create_bug_with_patch expects a file-like object
    611         bug_id = tool.bugs.create_bug_with_patch(bug_title, comment_text, options.component, diff_file, "Patch v1", cc=options.cc, mark_for_review=options.review)
     613        bug_id = tool.bugs.create_bug_with_patch(bug_title, comment_text, options.component, diff_file, "Patch v1", cc=options.cc, mark_for_review=options.review, mark_for_commit_queue=options.request_commit)
    612614
    613615    def prompt_for_bug_title_and_comment(self):
  • trunk/WebKitTools/Scripts/modules/bugzilla.py

    r48794 r50107  
    295295        self.authenticated = True
    296296
    297     def add_patch_to_bug(self, bug_id, patch_file_object, description, comment_text=None, mark_for_review=False):
     297    def _fill_attachment_form(self, description, patch_file_object, comment_text=None, mark_for_review=False, mark_for_commit_queue=False, bug_id=None):
     298        self.browser['description'] = description
     299        self.browser['ispatch'] = ("1",)
     300        self.browser['flag_type-1'] = ('?',) if mark_for_review else ('X',)
     301        self.browser['flag_type-3'] = ('?',) if mark_for_commit_queue else ('X',)
     302        if bug_id:
     303            patch_name = "bug-%s-%s.patch" % (bug_id, timestamp())
     304        else:
     305            patch_name ="%s.patch" % timestamp()
     306        self.browser.add_file(patch_file_object, "text/plain", patch_name, 'data')
     307
     308    def add_patch_to_bug(self, bug_id, patch_file_object, description, comment_text=None, mark_for_review=False, mark_for_commit_queue=False):
    298309        self.authenticate()
    299310       
     
    305316        self.browser.open("%sattachment.cgi?action=enter&bugid=%s" % (self.bug_server_url, bug_id))
    306317        self.browser.select_form(name="entryform")
    307         self.browser['description'] = description
    308         self.browser['ispatch'] = ("1",)
     318        self._fill_attachment_form(description, patch_file_object, mark_for_review=mark_for_review, mark_for_commit_queue=mark_for_commit_queue, bug_id=bug_id)
    309319        if comment_text:
    310320            log(comment_text)
    311321            self.browser['comment'] = comment_text
    312         self.browser['flag_type-1'] = ('?',) if mark_for_review else ('X',)
    313         self.browser.add_file(patch_file_object, "text/plain", "bug-%s-%s.patch" % (bug_id, timestamp()))
    314322        self.browser.submit()
    315323
     
    335343        raise BugzillaError("Bug not created: %s" % error_message)
    336344
    337     def create_bug_with_patch(self, bug_title, bug_description, component, patch_file_object, patch_description, cc, mark_for_review=False):
     345    def create_bug_with_patch(self, bug_title, bug_description, component, patch_file_object, patch_description, cc, mark_for_review=False, mark_for_commit_queue=False):
    338346        self.authenticate()
    339347
     
    356364            log(bug_description)
    357365            self.browser['comment'] = bug_description
    358         self.browser['description'] = patch_description
    359         self.browser['ispatch'] = ("1",)
    360         self.browser['flag_type-1'] = ('?',) if mark_for_review else ('X',)
    361         self.browser.add_file(patch_file_object, "text/plain", "%s.patch" % timestamp(), 'data')
     366
     367        self._fill_attachment_form(patch_description, patch_file_object, mark_for_review=mark_for_review, mark_for_commit_queue=mark_for_commit_queue)
    362368        response = self.browser.submit()
    363369
Note: See TracChangeset for help on using the changeset viewer.