[Pkg-bazaar-commits] ./bzr/unstable r614: - unify two defintions of LockError

Martin Pool mbp at sourcefrog.net
Fri Apr 10 08:20:19 UTC 2009


------------------------------------------------------------
revno: 614
committer: Martin Pool <mbp at sourcefrog.net>
timestamp: Wed 2005-06-01 14:09:38 +1000
message:
  - unify two defintions of LockError
modified:
  bzrlib/branch.py
  bzrlib/errors.py
  bzrlib/lock.py
-------------- next part --------------
=== modified file 'bzrlib/branch.py'
--- a/bzrlib/branch.py	2005-05-31 08:56:07 +0000
+++ b/bzrlib/branch.py	2005-06-01 04:09:38 +0000
@@ -122,8 +122,8 @@
         If _lock_mode is true, a positive count of the number of times the
         lock has been taken.
 
-    _lockfile
-        Open file used for locking.
+    _lock
+        Lock object from bzrlib.lock.
     """
     base = None
     _lock_mode = None

=== modified file 'bzrlib/errors.py'
--- a/bzrlib/errors.py	2005-05-31 08:10:44 +0000
+++ b/bzrlib/errors.py	2005-06-01 04:09:38 +0000
@@ -51,8 +51,18 @@
     pass
 
 
-class LockError(BzrError):
-    pass
+class LockError(Exception):
+    """All exceptions from the lock/unlock functions should be from
+    this exception class.  They will be translated as necessary. The
+    original exception is available as e.original_error
+    """
+    def __init__(self, e=None):
+        self.original_error = e
+        if e:
+            Exception.__init__(self, e)
+        else:
+            Exception.__init__(self)
+
 
 
 def bailout(msg, explanation=[]):

=== modified file 'bzrlib/lock.py'
--- a/bzrlib/lock.py	2005-05-27 05:10:23 +0000
+++ b/bzrlib/lock.py	2005-06-01 04:09:38 +0000
@@ -27,24 +27,15 @@
 different threads in a single process.  
 
 Eventually we may need to use some kind of lock representation that
-will work on a dumb filesystem without actual locking primitives."""
+will work on a dumb filesystem without actual locking primitives.
+"""
 
 
 import sys, os
 
 import bzrlib
 from trace import mutter, note, warning
-
-class LockError(Exception):
-    """All exceptions from the lock/unlock functions should be from this exception class.
-    They will be translated as necessary. The original exception is available as e.original_error
-    """
-    def __init__(self, e=None):
-        self.original_error = e
-        if e:
-            Exception.__init__(self, e)
-        else:
-            Exception.__init__(self)
+from errors import LockError
 
 try:
     import fcntl



More information about the Pkg-bazaar-commits mailing list