[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 00:11:26 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 437aabefd4334d1c315075555046d743a31ad8dd
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 2 10:44:28 2009 +0000

    2009-12-02  Eric Seidel  <eric at webkit.org>
    
            Reviewed by Adam Barth.
    
            REGRESSION(51590): style-queue and build-queue think their empty when they are not
            https://bugs.webkit.org/show_bug.cgi?id=32061
    
            * Scripts/modules/bugzilla.py: make all id lookups return ints instead of strings.
            * Scripts/modules/bugzilla_unittest.py: Add and update unit tests to use ints.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51595 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 959b908..33bda4d 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -2,6 +2,16 @@
 
         Reviewed by Adam Barth.
 
+        REGRESSION(51590): style-queue and build-queue think their empty when they are not
+        https://bugs.webkit.org/show_bug.cgi?id=32061
+
+        * Scripts/modules/bugzilla.py: make all id lookups return ints instead of strings.
+        * Scripts/modules/bugzilla_unittest.py: Add and update unit tests to use ints.
+
+2009-12-02  Eric Seidel  <eric at webkit.org>
+
+        Reviewed by Adam Barth.
+
         build-queue is throwing exceptions and complaining about
         lack of --no-update on build-attachment.  Make it stop.
 
diff --git a/WebKitTools/Scripts/modules/bugzilla.py b/WebKitTools/Scripts/modules/bugzilla.py
index dd2e569..5f16091 100644
--- a/WebKitTools/Scripts/modules/bugzilla.py
+++ b/WebKitTools/Scripts/modules/bugzilla.py
@@ -95,10 +95,10 @@ def is_mac_os_x():
 def parse_bug_id(message):
     match = re.search("http\://webkit\.org/b/(?P<bug_id>\d+)", message)
     if match:
-        return match.group('bug_id')
+        return int(match.group('bug_id'))
     match = re.search(Bugzilla.bug_server_regex + "show_bug\.cgi\?id=(?P<bug_id>\d+)", message)
     if match:
-        return match.group('bug_id')
+        return int(match.group('bug_id'))
     return None
 
 # FIXME: This should not depend on git for config storage
@@ -173,7 +173,7 @@ class Bugzilla:
         attachment['bug_id'] = bug_id
         attachment['is_obsolete'] = (element.has_key('isobsolete') and element['isobsolete'] == "1")
         attachment['is_patch'] = (element.has_key('ispatch') and element['ispatch'] == "1")
-        attachment['id'] = str(element.find('attachid').string)
+        attachment['id'] = int(element.find('attachid').string)
         attachment['url'] = self.attachment_url_for_id(attachment['id'])
         attachment['name'] = unicode(element.find('desc').string)
         attachment['type'] = str(element.find('type').string)
@@ -217,7 +217,9 @@ class Bugzilla:
             return None
         attachments = self.fetch_attachments_from_bug(bug_id)
         for attachment in attachments:
-            if attachment['id'] == attachment_id:
+            # FIXME: Once we have a real Attachment class we shouldn't paper over this possible comparison failure
+            # and we should remove the int() == int() hacks and leave it just ==.
+            if int(attachment['id']) == int(attachment_id):
                 self._validate_committer_and_reviewer(attachment)
                 return attachment
         return None # This should never be hit.
diff --git a/WebKitTools/Scripts/modules/bugzilla_unittest.py b/WebKitTools/Scripts/modules/bugzilla_unittest.py
index 50c20c5..13bf55a 100644
--- a/WebKitTools/Scripts/modules/bugzilla_unittest.py
+++ b/WebKitTools/Scripts/modules/bugzilla_unittest.py
@@ -29,7 +29,7 @@
 import unittest
 
 from modules.committers import CommitterList, Reviewer, Committer
-from modules.bugzilla import Bugzilla
+from modules.bugzilla import Bugzilla, parse_bug_id
 
 from modules.BeautifulSoup import BeautifulSoup
 
@@ -61,10 +61,10 @@ class BugzillaTest(unittest.TestCase):
         </attachment>
 '''
     _expected_example_attachment_parsing = {
-        'bug_id' : "100",
+        'bug_id' : 100,
         'is_obsolete' : True,
         'is_patch' : True,
-        'id' : "33721",
+        'id' : 33721,
         'url' : "https://bugs.webkit.org/attachment.cgi?id=33721",
         'name' : "Fixed whitespace issue",
         'type' : "text/plain",
@@ -74,6 +74,20 @@ class BugzillaTest(unittest.TestCase):
         'committer_email' : 'two at test.com',
     }
 
+    def test_parse_bug_id(self):
+        # FIXME: These would be all better as doctests
+        bugs = Bugzilla()
+        self.assertEquals(12345, parse_bug_id("http://webkit.org/b/12345"))
+        self.assertEquals(12345, parse_bug_id("http://bugs.webkit.org/show_bug.cgi?id=12345"))
+        self.assertEquals(12345, parse_bug_id(bugs.short_bug_url_for_bug_id(12345)))
+        self.assertEquals(12345, parse_bug_id(bugs.bug_url_for_bug_id(12345)))
+        self.assertEquals(12345, parse_bug_id(bugs.bug_url_for_bug_id(12345, xml=True)))
+
+        # Our bug 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"))
+
+
     def test_attachment_parsing(self):
         bugzilla = Bugzilla()
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list