Changeset 80537 in webkit


Ignore:
Timestamp:
Mar 7, 2011 9:58:26 PM (13 years ago)
Author:
ojan@chromium.org
Message:

2011-03-07 Ojan Vafai <ojan@chromium.org>

Reviewed by Adam Barth.

add webkit-patch attach-to-bug for posting to bugzilla from the commandline
https://bugs.webkit.org/show_bug.cgi?id=55749

  • Scripts/webkitpy/tool/commands/upload.py:
  • Scripts/webkitpy/tool/commands/upload_unittest.py:
  • Scripts/webkitpy/tool/steps/init.py:
  • Scripts/webkitpy/tool/steps/attachtobug.py: Added.
  • Scripts/webkitpy/tool/steps/options.py:
Location:
trunk/Tools
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r80536 r80537  
     12011-03-07  Ojan Vafai  <ojan@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        add webkit-patch attach-to-bug for posting to bugzilla from the commandline
     6        https://bugs.webkit.org/show_bug.cgi?id=55749
     7
     8        * Scripts/webkitpy/tool/commands/upload.py:
     9        * Scripts/webkitpy/tool/commands/upload_unittest.py:
     10        * Scripts/webkitpy/tool/steps/__init__.py:
     11        * Scripts/webkitpy/tool/steps/attachtobug.py: Added.
     12        * Scripts/webkitpy/tool/steps/options.py:
     13
    1142011-03-07  Daniel Cheng  <dcheng@chromium.org>
    215
  • trunk/Tools/Scripts/webkitpy/tool/commands/upload.py

    r77913 r80537  
    174174
    175175
     176class AttachToBug(AbstractSequencedCommand):
     177    name = "attach-to-bug"
     178    help_text = "Attach the the file to the bug"
     179    argument_names = "BUGID FILEPATH"
     180    steps = [
     181        steps.AttachToBug,
     182    ]
     183
     184    def _prepare_state(self, options, args, tool):
     185        state = {}
     186        state["bug_id"] = args[0]
     187        state["filepath"] = args[1]
     188        return state
     189
     190
    176191class AbstractPatchUploadingCommand(AbstractSequencedCommand):
    177192    def _bug_id(self, options, args, tool, state):
  • trunk/Tools/Scripts/webkitpy/tool/commands/upload_unittest.py

    r76926 r80537  
    6969        self.assert_execute_outputs(Post(), [42], options=options, expected_stderr=expected_stderr)
    7070
     71    def test_attach_to_bug(self):
     72        options = MockOptions()
     73        options.comment = "extra comment"
     74        options.description = "file description"
     75        expected_stderr = """MOCK add_attachment_to_bug: bug_id=42, description=file description filename=None
     76-- Begin comment --
     77extra comment
     78-- End comment --
     79"""
     80        self.assert_execute_outputs(AttachToBug(), [42, "path/to/file.txt", "file description"], options=options, expected_stderr=expected_stderr)
     81
     82    def test_attach_to_bug_no_description_or_comment(self):
     83        options = MockOptions()
     84        options.comment = None
     85        options.description = None
     86        expected_stderr = """MOCK add_attachment_to_bug: bug_id=42, description=file.txt filename=None
     87"""
     88        self.assert_execute_outputs(AttachToBug(), [42, "path/to/file.txt"], options=options, expected_stderr=expected_stderr)
     89
    7190    def test_land_safely(self):
    7291        expected_stderr = "Obsoleting 2 old patches on bug 42\nMOCK add_patch_to_bug: bug_id=42, description=Patch for landing, mark_for_review=False, mark_for_commit_queue=False, mark_for_landing=True\n"
  • trunk/Tools/Scripts/webkitpy/tool/steps/__init__.py

    r76926 r80537  
    3030from webkitpy.tool.steps.applypatch import ApplyPatch
    3131from webkitpy.tool.steps.applypatchwithlocalcommit import ApplyPatchWithLocalCommit
     32from webkitpy.tool.steps.attachtobug import AttachToBug
    3233from webkitpy.tool.steps.build import Build
    3334from webkitpy.tool.steps.checkstyle import CheckStyle
  • trunk/Tools/Scripts/webkitpy/tool/steps/options.py

    r73827 r80537  
    4141    component = make_option("--component", action="store", type="string", dest="component", help="Component for the new bug.")
    4242    confirm = make_option("--no-confirm", action="store_false", dest="confirm", default=True, help="Skip confirmation steps.")
    43     description = make_option("-m", "--description", action="store", type="string", dest="description", help="Description string for the attachment (default: \"patch\")")
     43    description = make_option("-m", "--description", action="store", type="string", dest="description", help="Description string for the attachment")
    4444    email = make_option("--email", action="store", type="string", dest="email", help="Email address to use in ChangeLogs.")
    4545    force_clean = make_option("--force-clean", action="store_true", dest="force_clean", default=False, help="Clean working directory before applying patches (removes local changes and commits)")
Note: See TracChangeset for help on using the changeset viewer.