Rev 2290: Remove some XXXs. in sftp://bazaar.launchpad.net/%7Ebzr/bzr/bzr.dev.hpss.api.changes/

Andrew Bennetts andrew.bennetts at canonical.com
Thu Apr 12 09:04:10 BST 2007


At sftp://bazaar.launchpad.net/%7Ebzr/bzr/bzr.dev.hpss.api.changes/

------------------------------------------------------------
revno: 2290
revision-id: andrew.bennetts at canonical.com-20070412080310-syj0orzfluo3ywb6
parent: andrew.bennetts at canonical.com-20070412074331-otphanb3q0tx6rfz
committer: Andrew Bennetts <andrew.bennetts at canonical.com>
branch nick: bzr.dev.hpss.api.changes
timestamp: Thu 2007-04-12 18:03:10 +1000
message:
  Remove some XXXs.
modified:
  bzrlib/lockable_files.py       control_files.py-20051111201905-bb88546e799d669f
  bzrlib/tests/test_lockable_files.py test_lockable_files.py-20051225183927-365c7fd99591caf1
=== modified file 'bzrlib/lockable_files.py'
--- a/bzrlib/lockable_files.py	2007-04-11 13:35:32 +0000
+++ b/bzrlib/lockable_files.py	2007-04-12 08:03:10 +0000
@@ -228,7 +228,6 @@
 
     def dont_leave_in_place(self):
         """Set this LockableFiles to clear the physical lock on unlock."""
-        # XXX: think about renaming this!
         self._lock.dont_leave_in_place()
 
     def lock_write(self, token=None):
@@ -258,8 +257,6 @@
             self._lock_mode = 'w'
             self._lock_count = 1
             self._set_transaction(transactions.WriteTransaction())
-            # XXX: add test for the case that requires self._token_from_lock:
-            # token = x.lock_write(); assert(x.lock_write() == token)
             self._token_from_lock = token_from_lock
             return token_from_lock
 

=== modified file 'bzrlib/tests/test_lockable_files.py'
--- a/bzrlib/tests/test_lockable_files.py	2007-04-12 07:37:25 +0000
+++ b/bzrlib/tests/test_lockable_files.py	2007-04-12 08:03:10 +0000
@@ -250,6 +250,23 @@
         new_lockable.lock_write()
         new_lockable.unlock()
 
+    def test_second_lock_write_returns_same_token(self):
+        first_token = self.lockable.lock_write()
+        try:
+            if first_token is None:
+                # This test does not apply, because this lockable refuses
+                # tokens.
+                return
+            # Relock the already locked lockable.  It should return the same
+            # token.
+            second_token = self.lockable.lock_write()
+            try:
+                self.assertEqual(first_token, second_token)
+            finally:
+                self.lockable.unlock()
+        finally:
+            self.lockable.unlock()
+
     def test_leave_in_place(self):
         token = self.lockable.lock_write()
         try:




More information about the bazaar-commits mailing list