Changeset 58066 in webkit


Ignore:
Timestamp:
Apr 21, 2010 11:59:19 PM (14 years ago)
Author:
abarth@webkit.org
Message:

2010-04-21 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

webkit-patch can't fetch attachments on security bugs
https://bugs.webkit.org/show_bug.cgi?id=37975

Instead of calling CURL, we just need to use our Mechanize object,
which understand bugs.webkit.org authentication.

  • Scripts/webkitpy/common/checkout/api.py:
  • Scripts/webkitpy/common/net/bugzilla.py:
Location:
trunk/WebKitTools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r58063 r58066  
     12010-04-21  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        webkit-patch can't fetch attachments on security bugs
     6        https://bugs.webkit.org/show_bug.cgi?id=37975
     7
     8        Instead of calling CURL, we just need to use our Mechanize object,
     9        which understand bugs.webkit.org authentication.
     10
     11        * Scripts/webkitpy/common/checkout/api.py:
     12        * Scripts/webkitpy/common/net/bugzilla.py:
     13
    1142010-04-21  Eric Seidel  <eric@webkit.org>
    215
  • trunk/WebKitTools/Scripts/webkitpy/common/checkout/api.py

    r57920 r58066  
    116116        # It's possible that the patch was not made from the root directory.
    117117        # We should detect and handle that case.
    118         # FIXME: Use Executive instead of subprocess here.
    119         curl_process = subprocess.Popen(['curl', '--location', '--silent', '--show-error', patch.url()], stdout=subprocess.PIPE)
    120118        # FIXME: Move _scm.script_path here once we get rid of all the dependencies.
    121119        args = [self._scm.script_path('svn-apply')]
     
    124122        if force:
    125123            args.append('--force')
    126 
    127         run_command(args, input=curl_process.stdout)
     124        run_command(args, input=patch.contents())
    128125
    129126    def apply_reverse_diff(self, revision):
  • trunk/WebKitTools/Scripts/webkitpy/common/net/bugzilla.py

    r58036 r58066  
    118118        return self._attachment_dictionary.get("url")
    119119
     120    def contents(self):
     121        # FIXME: We shouldn't be grabbing at _bugzilla.
     122        return self._bug._bugzilla.fetch_attachment_contents(self.id())
     123
    120124    def _validate_flag_value(self, flag):
    121125        email = self._attachment_dictionary.get("%s_email" % flag)
     
    487491        return Bug(self.fetch_bug_dictionary(bug_id), self)
    488492
     493    def fetch_attachment_contents(self, attachment_id):
     494        attachment_url = self.attachment_url_for_id(attachment_id)
     495        # We need to authenticate to download patches from security bugs.
     496        self.authenticate()
     497        return self.browser.open(attachment_url).read()
     498
    489499    def _parse_bug_id_from_attachment_page(self, page):
    490500        # The "Up" relation happens to point to the bug.
Note: See TracChangeset for help on using the changeset viewer.