Rev 5118: Rename the function. in http://bazaar.launchpad.net/~jameinel/bzr/2.2.0b2-pack-collection

John Arbash Meinel john at arbash-meinel.com
Wed Jun 16 16:56:57 BST 2010


At http://bazaar.launchpad.net/~jameinel/bzr/2.2.0b2-pack-collection

------------------------------------------------------------
revno: 5118
revision-id: john at arbash-meinel.com-20100616155647-g3icr115x7k1ry0h
parent: john at arbash-meinel.com-20100602205350-fylo0d3vh6gh2nii
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.2.0b2-pack-collection
timestamp: Wed 2010-06-16 10:56:47 -0500
message:
  Rename the function.
-------------- next part --------------
=== modified file 'bzrlib/pack_collection.py'
--- a/bzrlib/pack_collection.py	2010-03-20 17:16:07 +0000
+++ b/bzrlib/pack_collection.py	2010-06-16 15:56:47 +0000
@@ -28,9 +28,9 @@
 class LockingPolicy(object):
     """Abstract Base Class that defines interactions with locking."""
 
-    def safe_to_cache(self):
+    def ensure_safe_to_cache(self):
         """Raise an exception if it is unsafe to cache data in memory."""
-        raise NotImplementedError(self.safe_to_cache)
+        raise NotImplementedError(self.ensure_safe_to_cache)
 
     def lock_write(self):
         """We are about to update the file, make sure that is safe to do."""
@@ -123,7 +123,7 @@
 
         :return: True if we had to read data from disk
         """
-        self.locking_policy.safe_to_cache()
+        self.locking_policy.ensure_safe_to_cache()
         if self._memos is not None:
             result = False
         else:
@@ -295,8 +295,8 @@
     def __init__(self, repo):
         self.repo = repo
 
-    def safe_to_cache(self):
-        """See LockingPolicy.safe_to_cache()"""
+    def ensure_safe_to_cache(self):
+        """See LockingPolicy.ensure_safe_to_cache()"""
         if not self.repo.is_locked():
             raise errors.ObjectNotLocked(self.repo)
 

=== modified file 'bzrlib/tests/test_pack_collection.py'
--- a/bzrlib/tests/test_pack_collection.py	2010-03-20 17:16:07 +0000
+++ b/bzrlib/tests/test_pack_collection.py	2010-06-16 15:56:47 +0000
@@ -48,7 +48,7 @@
 class TrivialLockingPolicy(pack_collection.LockingPolicy):
     """Stub out the necessary functionality with trivial implementations."""
 
-    def safe_to_cache(self):
+    def ensure_safe_to_cache(self):
         return #Always safe
 
     def lock_write(self):



More information about the bazaar-commits mailing list