Rev 5350: Delete the after_cleanup_size parameter from the LRUCache constructor. in file:///home/vila/src/bzr/cleanup/deprecations/

Vincent Ladeuil v.ladeuil+lp at free.fr
Thu Jul 15 14:05:40 BST 2010


At file:///home/vila/src/bzr/cleanup/deprecations/

------------------------------------------------------------
revno: 5350
revision-id: v.ladeuil+lp at free.fr-20100715130540-nac9q1yu78870v0e
parent: v.ladeuil+lp at free.fr-20100715125344-gq3hjy9t471pnnyv
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: deprecations
timestamp: Thu 2010-07-15 15:05:40 +0200
message:
  Delete the after_cleanup_size parameter from the LRUCache constructor.
-------------- next part --------------
=== modified file 'bzrlib/lru_cache.py'
--- a/bzrlib/lru_cache.py	2009-07-08 15:43:51 +0000
+++ b/bzrlib/lru_cache.py	2010-07-15 13:05:40 +0000
@@ -17,7 +17,6 @@
 """A simple least-recently-used (LRU) cache."""
 
 from bzrlib import (
-    symbol_versioning,
     trace,
     )
 
@@ -61,14 +60,7 @@
 class LRUCache(object):
     """A class which manages a cache of entries, removing unused ones."""
 
-    def __init__(self, max_cache=100, after_cleanup_count=None,
-                 after_cleanup_size=symbol_versioning.DEPRECATED_PARAMETER):
-        if symbol_versioning.deprecated_passed(after_cleanup_size):
-            symbol_versioning.warn('LRUCache.__init__(after_cleanup_size) was'
-                                   ' deprecated in 1.11. Use'
-                                   ' after_cleanup_count instead.',
-                                   DeprecationWarning)
-            after_cleanup_count = after_cleanup_size
+    def __init__(self, max_cache=100, after_cleanup_count=None):
         self._cache = {}
         # The "HEAD" of the lru linked list
         self._most_recently_used = None

=== modified file 'bzrlib/tests/test_lru_cache.py'
--- a/bzrlib/tests/test_lru_cache.py	2009-07-08 14:28:04 +0000
+++ b/bzrlib/tests/test_lru_cache.py	2010-07-15 13:05:40 +0000
@@ -282,13 +282,6 @@
         cache[6] = 7
         self.assertEqual([2, 3, 4, 5, 6], sorted(cache.keys()))
 
-    def test_after_cleanup_size_deprecated(self):
-        obj = self.callDeprecated([
-            'LRUCache.__init__(after_cleanup_size) was deprecated in 1.11.'
-            ' Use after_cleanup_count instead.'],
-            lru_cache.LRUCache, 50, after_cleanup_size=25)
-        self.assertEqual(obj._after_cleanup_count, 25)
-
     def test_resize_smaller(self):
         cache = lru_cache.LRUCache(max_cache=5, after_cleanup_count=4)
         cache[1] = 2



More information about the bazaar-commits mailing list