[Zodb-checkins] CVS: ZODB4/src/zodb/storage - base.py:1.5.2.2

Barry Warsaw barry@wooz.org
Thu, 23 Jan 2003 13:54:04 -0500


Update of /cvs-repository/ZODB4/src/zodb/storage
In directory cvs.zope.org:/tmp/cvs-serv28857

Modified Files:
      Tag: new-pickle-branch
	base.py 
Log Message:
BerkeleyBase
    .setVersion(), .getVersion(), ._setVersion(): methods to support
    the database serialization version for the Berkeley storages.


=== ZODB4/src/zodb/storage/base.py 1.5.2.1 => 1.5.2.2 ===
--- ZODB4/src/zodb/storage/base.py:1.5.2.1	Tue Jan 21 11:20:39 2003
+++ ZODB4/src/zodb/storage/base.py	Thu Jan 23 13:54:01 2003
@@ -670,6 +670,19 @@
         # performed by the methods in the derived storage class.
         pass
 
+    def _setVersion(self, txn, vstr):
+        self._info.put('dbversion', vstr, txn=txn)
+
+    def setVersion(self, version):
+        encvers = encode_version(version)
+        self._withtxn(self._setVersion, encvers)
+
+    def getVersion(self):
+        version = self._info.get('dbversion')
+        if version is not None:
+            return decode_version(version)
+        return version
+
     def close(self):
         """Close the storage.