[Zodb-checkins] CVS: ZODB3/bsddb3Storage/bsddb3Storage - Full.py:1.60

Barry Warsaw barry@wooz.org
Tue, 10 Dec 2002 16:41:44 -0500


Update of /cvs-repository/ZODB3/bsddb3Storage/bsddb3Storage
In directory cvs.zope.org:/tmp/cvs-serv19169

Modified Files:
	Full.py 
Log Message:
UndoError() constructor now takes its arguments in reverse order,
i.e. reason first, then oid.  This is because there's always a reason
but sometimes there isn't an oid (so we can default arg the oid).


=== ZODB3/bsddb3Storage/bsddb3Storage/Full.py 1.59 => 1.60 ===
--- ZODB3/bsddb3Storage/bsddb3Storage/Full.py:1.59	Fri Dec  6 16:15:07 2002
+++ ZODB3/bsddb3Storage/bsddb3Storage/Full.py	Tue Dec 10 16:41:44 2002
@@ -1088,7 +1088,8 @@
             # The object's revision is in it's initial creation state but
             # we're asking for an undo of something other than the initial
             # creation state.  No, no.
-            raise POSException.UndoError, 'Undoing mismatched zombification'
+            raise POSException.UndoError(
+                'Undoing mismatched zombification', oid)
         last_lrevid     = self._metadata[oid+last_prevrevid][16:24]
         target_metadata = self._metadata[oid+target_prevrevid]
         target_lrevid   = target_metadata[16:24]
@@ -1108,13 +1109,13 @@
             if data:
                 return oid, target_metadata, data
             else:
-                raise POSException.UndoError, 'Cannot undo transaction'
+                raise POSException.UndoError('Cannot undo transaction', oid)
 
     def _dotxnundo(self, txn, tid):
         # First, make sure the transaction isn't protected by a pack.
         packtime = self._last_packtime()
         if tid <= packtime:
-            raise POSException.UndoError, 'Transaction cannot be undone'
+            raise POSException.UndoError('Transaction cannot be undone')
         # Calculate all the oids of objects modified in this transaction
         newrevs = []
         c = self._txnoids.cursor(txn=txn)