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

abarth at webkit.org abarth at webkit.org
Wed Apr 7 23:42:03 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit a2c69237b9d1853daeca3ea6bf3b11b600820721
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Nov 15 23:24:34 2009 +0000

    2009-11-15  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Darin Adler.
    
            Add bugzilla-tool check-style
            https://bugs.webkit.org/show_bug.cgi?id=31515
    
            * Scripts/bugzilla-tool:
            * Scripts/modules/bugzilla.py:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51001 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index e16a51f..96cfa02 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,13 @@
+2009-11-15  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Add bugzilla-tool check-style
+        https://bugs.webkit.org/show_bug.cgi?id=31515
+
+        * Scripts/bugzilla-tool:
+        * Scripts/modules/bugzilla.py:
+
 2009-11-13  Kenneth Rohde Christiansen  <kenneth at webkit.org>
 
         Reviewed by Simon Hausmann.
diff --git a/WebKitTools/Scripts/bugzilla-tool b/WebKitTools/Scripts/bugzilla-tool
index 6ad29e8..ea4a981 100755
--- a/WebKitTools/Scripts/bugzilla-tool
+++ b/WebKitTools/Scripts/bugzilla-tool
@@ -135,6 +135,34 @@ class ReviewedPatchesOnBug(Command):
             print "%s" % patch['url']
 
 
+class CheckStyleOnBug(Command):
+    def __init__(self):
+        options = WebKitLandingScripts.cleaning_options()
+        Command.__init__(self, 'Runs check-webkit-style on the r? patches on a bug', 'BUGID', options=options)
+
+    @classmethod
+    def check_style(cls, bug_id, patch, options, tool):
+        tool.scm().update_webkit()
+        log("Checking style for patch %s from bug %s." % (patch['id'], bug_id))
+        try:
+            tool.scm().apply_patch(patch)
+            WebKitLandingScripts.run_webkit_script("check-webkit-style")
+        except ScriptError, e:
+            log("Patch failed to apply and check style")
+            log(e.output)
+
+        tool.scm().ensure_clean_working_directory(True)
+
+    def execute(self, options, args, tool):
+        bug_id = args[0]
+        patches = tool.bugs.fetch_unreviewed_patches_from_bug(bug_id)
+
+        WebKitLandingScripts.setup_for_landing(tool.scm(), options)
+
+        for patch in patches:
+            self.check_style(bug_id, patch, options, tool)
+
+
 class ApplyPatchesFromBug(Command):
     def __init__(self):
         options = [
@@ -812,6 +840,7 @@ class BugzillaTool:
             { 'name' : 'apply-patches', 'object' : ApplyPatchesFromBug() },
             { 'name' : 'land-diff', 'object' : LandAndUpdateBug() },
             { 'name' : 'land-patches', 'object' : LandPatchesFromBugs() },
+            { 'name' : 'check-style', 'object' : CheckStyleOnBug() },
             { 'name' : 'commit-message', 'object' : CommitMessageForCurrentDiff() },
             { 'name' : 'obsolete-attachments', 'object' : ObsoleteAttachmentsOnBug() },
             { 'name' : 'post-diff', 'object' : PostDiffAsPatchToBug() },
diff --git a/WebKitTools/Scripts/modules/bugzilla.py b/WebKitTools/Scripts/modules/bugzilla.py
index 9b7c5b7..fbbaebc 100644
--- a/WebKitTools/Scripts/modules/bugzilla.py
+++ b/WebKitTools/Scripts/modules/bugzilla.py
@@ -163,8 +163,10 @@ class Bugzilla:
 
     def _parse_attachment_flag(self, element, flag_name, attachment, result_key):
         flag = element.find('flag', attrs={'name' : flag_name})
-        if flag and flag['status'] == '+':
-            attachment[result_key] = flag['setter']
+        if flag:
+            attachment[flag_name] = flag['status']
+            if flag['status'] == '+':
+                attachment[result_key] = flag['setter']
 
     def _parse_attachment_element(self, element, bug_id):
         attachment = {}
@@ -233,6 +235,13 @@ class Bugzilla:
     def _validate_committer(self, patch, reject_invalid_patches):
         return self._validate_setter_email(patch, 'committer', self.committers.committer_by_email, self.reject_patch_from_commit_queue, reject_invalid_patches)
 
+    def fetch_unreviewed_patches_from_bug(self, bug_id):
+        unreviewed_patches = []
+        for attachment in self.fetch_attachments_from_bug(bug_id):
+            if attachment.get('review') == '?' and not attachment['is_obsolete']:
+                unreviewed_patches.append(attachment)
+        return unreviewed_patches
+
     def fetch_reviewed_patches_from_bug(self, bug_id, reject_invalid_patches=False):
         reviewed_patches = []
         for attachment in self.fetch_attachments_from_bug(bug_id):
diff --git a/WebKitTools/Scripts/modules/scm.py b/WebKitTools/Scripts/modules/scm.py
index 3ffa23b..8a87aa7 100644
--- a/WebKitTools/Scripts/modules/scm.py
+++ b/WebKitTools/Scripts/modules/scm.py
@@ -168,7 +168,9 @@ class SCM:
         # It's possible that the patch was not made from the root directory.
         # We should detect and handle that case.
         curl_process = subprocess.Popen(['curl', '--location', '--silent', '--show-error', patch['url']], stdout=subprocess.PIPE)
-        args = [self.script_path('svn-apply'), '--reviewer', patch['reviewer']]
+        args = [self.script_path('svn-apply')]
+        if patch.get('reviewer'):
+            args += ['--reviewer', patch['reviewer']]
         if force:
             args.append('--force')
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list