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

abarth at webkit.org abarth at webkit.org
Thu Apr 8 00:28:58 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 189b25d258ea20c08b31735ce39c671e351b9cd0
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 9 09:39:10 2009 +0000

    2009-12-09  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            [bzt] Remove unused PatchCollection class
            https://bugs.webkit.org/show_bug.cgi?id=32312
    
            It's dead code.
    
            * Scripts/modules/patchcollection.py:
            * Scripts/modules/patchcollection_unittest.py: Removed.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51895 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index d7b53f7..b4f0581 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,5 +1,17 @@
 2009-12-09  Adam Barth  <abarth at webkit.org>
 
+        Reviewed by Eric Seidel.
+
+        [bzt] Remove unused PatchCollection class
+        https://bugs.webkit.org/show_bug.cgi?id=32312
+
+        It's dead code.
+
+        * Scripts/modules/patchcollection.py:
+        * Scripts/modules/patchcollection_unittest.py: Removed.
+
+2009-12-09  Adam Barth  <abarth at webkit.org>
+
         Unreviewed "build" fix.  CheckStyle needs a --no-upate option.
 
         * Scripts/modules/commands/download.py:
diff --git a/WebKitTools/Scripts/modules/commands/queues.py b/WebKitTools/Scripts/modules/commands/queues.py
index b907f03..53b9e48 100644
--- a/WebKitTools/Scripts/modules/commands/queues.py
+++ b/WebKitTools/Scripts/modules/commands/queues.py
@@ -38,7 +38,7 @@ from modules.grammar import pluralize
 from modules.landingsequence import LandingSequence, LandingSequenceErrorHandler
 from modules.logging import error, log
 from modules.multicommandtool import Command
-from modules.patchcollection import PatchCollection, PersistentPatchCollection, PersistentPatchCollectionDelegate
+from modules.patchcollection import PersistentPatchCollection, PersistentPatchCollectionDelegate
 from modules.statusbot import StatusBot
 from modules.workqueue import WorkQueue, WorkQueueDelegate
 
diff --git a/WebKitTools/Scripts/modules/patchcollection.py b/WebKitTools/Scripts/modules/patchcollection.py
index ceed581..add8129 100644
--- a/WebKitTools/Scripts/modules/patchcollection.py
+++ b/WebKitTools/Scripts/modules/patchcollection.py
@@ -27,38 +27,6 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-class PatchCollection:
-    def __init__(self, bugs, filter=None):
-        self._bugs = bugs
-        self._filter = filter
-        self._patches = []
-
-    def add(self, patch):
-        self.add_patches([patch])
-
-    def add_patches(self, patches):
-        for patch in patches:
-            if not patch:
-                continue
-            if self._filter and not self._filter(patch):
-                continue
-            self._patches.append(patch)
-
-    def add_patches_from_bug(self, bug_id):
-        self.add_patches(self._bugs.fetch_patches_from_bug(bug_id))
-
-    def next(self):
-        if not self._patches:
-            return None
-        return self._patches.pop(0)
-
-    def patch_ids(self):
-        return map(lambda patch: patch['id'], self._patches)
-
-    def __len__(self):
-        return len(self._patches)
-
-
 class PersistentPatchCollectionDelegate:
     def collection_name(self):
         raise NotImplementedError, "subclasses must implement"
diff --git a/WebKitTools/Scripts/modules/patchcollection_unittest.py b/WebKitTools/Scripts/modules/patchcollection_unittest.py
deleted file mode 100644
index dd0b86e..0000000
--- a/WebKitTools/Scripts/modules/patchcollection_unittest.py
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2009, Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-# 
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import unittest
-
-from modules.patchcollection import PatchCollection
-
-def test_filter(patch):
-    return not patch == MockBugzilla.patch_3
-
-class MockBugzilla:
-    patch_1 = ("patch", 1)
-    patch_2 = ("patch", 2)
-    patch_3 = ("patch", 3)
-    patch_4 = ("patch", 4)
-
-    def fetch_attachment(self, patch_id):
-        return self.patch_1
-
-    def fetch_patches_from_bug(self, bug_id):
-        return [self.patch_2, self.patch_3, self.patch_4]
-
-
-class MockEmptyBugzilla:
-    def fetch_attachment(self, patch_id):
-        return None
-
-    def fetch_patches_from_bug(self, bug_id):
-        return []
-
-
-class PatchCollectionTest(unittest.TestCase):
-    def test_basic(self):
-        bugs = MockBugzilla()
-        patches = PatchCollection(bugs, filter=test_filter)
-        self.assertEqual(len(patches), 0)
-        patches.add(bugs.fetch_attachment(42))
-        self.assertEqual(len(patches), 1)
-        patch = patches.next()
-        self.assertEqual(patch, MockBugzilla.patch_1)
-        self.assertEqual(len(patches), 0)
-        patches.add_patches_from_bug(38)
-        # Notice that one of the patches gets filtered out.
-        self.assertEqual(len(patches), 2)
-        patch = patches.next()
-        self.assertEqual(patch, MockBugzilla.patch_2)
-        self.assertEqual(len(patches), 1)
-        patch = patches.next()
-        self.assertEqual(patch, MockBugzilla.patch_4)
-        self.assertEqual(len(patches), 0)
-
-    def test_no_patch(self):
-        bugs = MockEmptyBugzilla()
-        patches = PatchCollection(bugs, filter=test_filter)
-        self.assertEqual(len(patches), 0)
-        patches.add(bugs.fetch_attachment(42))
-        self.assertEqual(len(patches), 0)
-        patches.add_patches_from_bug(38)
-        self.assertEqual(len(patches), 0)
-
-    def test_add_patches(self):
-        patches = PatchCollection(None)
-        self.assertEqual(patches.patch_ids(), [])
-        patches.add_patches([{'id': 42}, {'id': 74}])
-        self.assertEqual(len(patches), 2)
-        self.assertEqual(patches.patch_ids(), [42, 74])
-
-    def test_patch_ids(self):
-        patches = PatchCollection(None)
-        self.assertEqual(patches.patch_ids(), [])
-        patches.add({'id': 42})
-        patches.add({'id': 74})
-        self.assertEqual(patches.patch_ids(), [42, 74])
-
-    def test_empty(self):
-        patches = PatchCollection(None)
-        self.assertEqual(patches.next(), None)
-
-if __name__ == '__main__':
-    unittest.main()
diff --git a/WebKitTools/Scripts/run-webkit-unittests b/WebKitTools/Scripts/run-webkit-unittests
index 960c91c..3487299 100755
--- a/WebKitTools/Scripts/run-webkit-unittests
+++ b/WebKitTools/Scripts/run-webkit-unittests
@@ -41,7 +41,6 @@ from modules.cpp_style_unittest import *
 from modules.diff_parser_unittest import *
 from modules.logging_unittest import *
 from modules.multicommandtool_unittest import *
-from modules.patchcollection_unittest import *
 from modules.scm_unittest import *
 from modules.webkitport_unittest import *
 from modules.workqueue_unittest import *

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list