webkit-patch apply-attachment is very slow for big patches
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 May 2012 12:08:16 +0000 (12:08 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 May 2012 12:08:16 +0000 (12:08 +0000)
https://bugs.webkit.org/show_bug.cgi?id=74929

Add "excludefield=attachmentdata" to the URL everywhere
"ctype=xml" is used to exclude this field from the XML.

Reviewed by Adam Barth.

* Scripts/prepare-ChangeLog:
(fetchBugDescriptionFromURL):
* Scripts/webkitpy/common/config/urls.py:
* Scripts/webkitpy/common/config/urls_unittest.py:
(URLsTest.test_parse_bug_id):
* Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
(Bugzilla.bug_url_for_bug_id):

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

Tools/ChangeLog
Tools/Scripts/prepare-ChangeLog
Tools/Scripts/webkitpy/common/config/urls.py
Tools/Scripts/webkitpy/common/config/urls_unittest.py
Tools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py

index 1600b53..8d5c73d 100644 (file)
@@ -1,3 +1,21 @@
+2012-05-14  David Kilzer  <ddkilzer@apple.com>
+
+        webkit-patch apply-attachment is very slow for big patches
+        https://bugs.webkit.org/show_bug.cgi?id=74929
+
+        Add "excludefield=attachmentdata" to the URL everywhere
+        "ctype=xml" is used to exclude this field from the XML.
+
+        Reviewed by Adam Barth.
+
+        * Scripts/prepare-ChangeLog:
+        (fetchBugDescriptionFromURL):
+        * Scripts/webkitpy/common/config/urls.py:
+        * Scripts/webkitpy/common/config/urls_unittest.py:
+        (URLsTest.test_parse_bug_id):
+        * Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
+        (Bugzilla.bug_url_for_bug_id):
+
 2012-05-13  Ryosuke Niwa  <rniwa@webkit.org>
 
         performance tests should be able to measure runs/sec rather than time
index 8a48e56..df687dc 100755 (executable)
@@ -345,7 +345,7 @@ sub fetchBugDescriptionFromURL($$)
 {
     my ($bugURL, $bugNumber) = @_;
 
-    my $bugXMLURL = "$bugURL&ctype=xml";
+    my $bugXMLURL = "$bugURL&ctype=xml&excludefield=attachmentdata";
     # Perl has no built in XML processing, so we'll fetch and parse with curl and grep
     # Pass --insecure because some cygwin installs have no certs we don't
     # care about validating that bugs.webkit.org is who it says it is here.
index 48830c5..88ad373 100644 (file)
@@ -47,7 +47,7 @@ bug_server_domain = "webkit.org"
 bug_server_host = "bugs." + bug_server_domain
 _bug_server_regex = "https?://%s/" % re.sub('\.', '\\.', bug_server_host)
 bug_server_url = "https://%s/" % bug_server_host
-bug_url_long = _bug_server_regex + r"show_bug\.cgi\?id=(?P<bug_id>\d+)(&ctype=xml)?"
+bug_url_long = _bug_server_regex + r"show_bug\.cgi\?id=(?P<bug_id>\d+)(&ctype=xml|&excludefield=attachmentdata)*"
 bug_url_short = r"https?\://%s/b/(?P<bug_id>\d+)" % bug_server_domain
 
 attachment_url = _bug_server_regex + r"attachment\.cgi\?id=(?P<attachment_id>\d+)(&action=(?P<action>\w+))?"
index 74c2240..2b94b86 100644 (file)
@@ -37,10 +37,17 @@ class URLsTest(unittest.TestCase):
         self.assertEquals(12345, parse_bug_id("http://webkit.org/b/12345"))
         self.assertEquals(12345, parse_bug_id("foo\n\nhttp://webkit.org/b/12345\nbar\n\n"))
         self.assertEquals(12345, parse_bug_id("http://bugs.webkit.org/show_bug.cgi?id=12345"))
+        self.assertEquals(12345, parse_bug_id("http://bugs.webkit.org/show_bug.cgi?id=12345&ctype=xml"))
+        self.assertEquals(12345, parse_bug_id("http://bugs.webkit.org/show_bug.cgi?id=12345&ctype=xml&excludefield=attachmentdata"))
+        self.assertEquals(12345, parse_bug_id("http://bugs.webkit.org/show_bug.cgi?id=12345excludefield=attachmentdata&ctype=xml"))
 
         # Our url parser is super-fragile, but at least we're testing it.
         self.assertEquals(None, parse_bug_id("http://www.webkit.org/b/12345"))
         self.assertEquals(None, parse_bug_id("http://bugs.webkit.org/show_bug.cgi?ctype=xml&id=12345"))
+        self.assertEquals(None, parse_bug_id("http://bugs.webkit.org/show_bug.cgi?ctype=xml&id=12345&excludefield=attachmentdata"))
+        self.assertEquals(None, parse_bug_id("http://bugs.webkit.org/show_bug.cgi?ctype=xml&excludefield=attachmentdata&id=12345"))
+        self.assertEquals(None, parse_bug_id("http://bugs.webkit.org/show_bug.cgi?excludefield=attachmentdata&ctype=xml&id=12345"))
+        self.assertEquals(None, parse_bug_id("http://bugs.webkit.org/show_bug.cgi?excludefield=attachmentdata&id=12345&ctype=xml"))
 
     def test_parse_attachment_id(self):
         self.assertEquals(12345, parse_attachment_id("https://bugs.webkit.org/attachment.cgi?id=12345&action=review"))
index 6186a95..1afa287 100644 (file)
@@ -308,7 +308,7 @@ class Bugzilla(object):
     def bug_url_for_bug_id(self, bug_id, xml=False):
         if not bug_id:
             return None
-        content_type = "&ctype=xml" if xml else ""
+        content_type = "&ctype=xml&excludefield=attachmentdata" if xml else ""
         return "%sshow_bug.cgi?id=%s%s" % (config_urls.bug_server_url, bug_id, content_type)
 
     def short_bug_url_for_bug_id(self, bug_id):