[Zodb-checkins] CVS: StandaloneZODB/bsddb3Storage/bsddb3Storage - Full.py:1.39 Minimal.py:1.12 MinimalReplicated.py:1.2 Packless.py:1.7

Guido van Rossum guido@python.org
Tue, 12 Feb 2002 17:33:10 -0500


Update of /cvs-repository/StandaloneZODB/bsddb3Storage/bsddb3Storage
In directory cvs.zope.org:/tmp/cvs-serv13020/bsddb3Storage/bsddb3Storage

Modified Files:
	Full.py Minimal.py MinimalReplicated.py Packless.py 
Log Message:
More changes merging the StandaloneZODB-1.0 release branch into the
trunk.  I'm *almost* done with the merge; the only file not yet merged
is FileStorage.py.



=== StandaloneZODB/bsddb3Storage/bsddb3Storage/Full.py 1.38 => 1.39 ===
+#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+# 
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+# 
+##############################################################################
+
 """Berkeley storage with full undo and versioning support.
 
 See Minimal.py for an implementation of Berkeley storage that does not support
@@ -593,9 +607,7 @@
                 if data:
                     conflictresolved = 1
                 else:
-                    raise POSException.ConflictError(
-                        'serial number mismatch (was: %s, has: %s)' %
-                        (U64(oserial), serial and U64(serial)))
+                    raise POSException.ConflictError(serials=(oserial, serial))
             # Do we already know about this version?  If not, we need to
             # record the fact that a new version is being created.  `version'
             # will be the empty string when the transaction is storing on the


=== StandaloneZODB/bsddb3Storage/bsddb3Storage/Minimal.py 1.11 => 1.12 ===
+#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+# 
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+# 
+##############################################################################
+
 """Berkeley storage without undo or versioning.
 
 See Full.py for an implementation of Berkeley storage that does support undo
@@ -176,8 +190,7 @@
                 # given in the call is not the same as the last stored serial
                 # number.  Raise a ConflictError.
                 raise POSException.ConflictError(
-                    'serial number mismatch (was: %s, has: %s)' %
-                    (utils.U64(oserial), utils.U64(serial)))
+                    serials=(oserial, serial))
             # Our serial number is updated in BaseStorage's tpc_begin() call,
             # which sets the serial number to the current timestamp.
             serial = self._serial


=== StandaloneZODB/bsddb3Storage/bsddb3Storage/MinimalReplicated.py 1.1 => 1.2 ===
+#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
+# 
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE
+# 
+##############################################################################
+
 from base import Base
 from bsddb3 import db
 from struct import pack, unpack
@@ -28,7 +42,8 @@
         try:
             if self._index.has_key(oid):
                 oserial=self._index[oid]
-                if serial != oserial: raise POSException.ConflictError
+                if serial != oserial:
+                    raise POSException.ConflictError(serials=(oserial, serial))
                 
             serial=self._serial
             self._tmp.write(oid+pack(">I", len(data)))


=== StandaloneZODB/bsddb3Storage/bsddb3Storage/Packless.py 1.6 => 1.7 ===
 # 
 ##############################################################################
+
 """
 An implementation of a BerkeleyDB-backed storage that uses a reference-
 counting garbage-collection strategy which necessitates packing only when
@@ -84,7 +85,8 @@
         try:
             if self._index.has_key(oid):
                 oserial=self._index[oid]
-                if serial != oserial: raise POSException.ConflictError
+                if serial != oserial:
+                    raise POSException.ConflictError(serials=(oserial, serial))
                 
             serial=self._serial
             try: