Rev 2282: Some tweaks in response to review. in sftp://bazaar.launchpad.net/%7Ebzr/bzr/bzr.dev.hpss.api.changes/
Andrew Bennetts
andrew.bennetts at canonical.com
Wed Mar 28 08:39:53 BST 2007
At sftp://bazaar.launchpad.net/%7Ebzr/bzr/bzr.dev.hpss.api.changes/
------------------------------------------------------------
revno: 2282
revision-id: andrew.bennetts at canonical.com-20070328073853-yje2ikoflt6a4jos
parent: andrew.bennetts at canonical.com-20070328070842-r843houy668oxb9o
committer: Andrew Bennetts <andrew.bennetts at canonical.com>
branch nick: bzr.dev.hpss.api.changes
timestamp: Wed 2007-03-28 17:38:53 +1000
message:
Some tweaks in response to review.
modified:
bzrlib/errors.py errors.py-20050309040759-20512168c4e14fbd
bzrlib/lockable_files.py control_files.py-20051111201905-bb88546e799d669f
bzrlib/lockdir.py lockdir.py-20060220222025-98258adf27fbdda3
=== modified file 'bzrlib/errors.py'
--- a/bzrlib/errors.py 2007-03-28 07:08:42 +0000
+++ b/bzrlib/errors.py 2007-03-28 07:38:53 +0000
@@ -799,7 +799,7 @@
self.obj = obj
-class TokenMismatch(LockError):
+class TokenMismatch(LockBroken):
_fmt = "The lock token %(given_token)r does not match lock token %(lock_token)r."
=== modified file 'bzrlib/lockable_files.py'
--- a/bzrlib/lockable_files.py 2007-03-28 07:08:42 +0000
+++ b/bzrlib/lockable_files.py 2007-03-28 07:38:53 +0000
@@ -232,6 +232,12 @@
instance doesn't support using token locks.
:raises MismatchedToken: if the specified token doesn't match the token
of the existing lock.
+
+ A token should be passed in if you know that you have locked the object
+ some other way, and need to synchronise this object's state with that
+ fact. For instance, this could happen when accessing the same branch
+ over bzr+ssh:// and then falling back to do some operations on the same
+ branch via sftp://.
"""
# mutter("lock write: %s (%s)", self, self._lock_count)
# TODO: Upgrade locking to support using a Transport,
=== modified file 'bzrlib/lockdir.py'
--- a/bzrlib/lockdir.py 2007-02-12 04:49:32 +0000
+++ b/bzrlib/lockdir.py 2007-03-28 07:38:53 +0000
@@ -428,8 +428,14 @@
:returns: a token if this instance supports tokens, otherwise None.
:raises TokenLockingNotSupported: when a token is given but this
instance doesn't support using token locks.
- :raises MismatchedToken: if the specified token doesn't match the token
+ :raises TokenMismatch: if the specified token doesn't match the token
of the existing lock.
+
+ A token should be passed in if you know that you have locked the object
+ some other way, and need to synchronise this object's state with that
+ fact. For instance, this could happen when accessing the same branch
+ over bzr+ssh:// and then falling back to do some operations on the same
+ branch via sftp://.
XXX: docstring duplicated from LockableFiles.lock_write.
"""
More information about the bazaar-commits
mailing list