[Zodb-checkins] SVN: ZODB/branches/3.3/src/ZODB/ Merge rev 28195
from trunk.
Dmitry Vasiliev
dima at hlabs.spb.ru
Fri Oct 15 07:38:40 EDT 2004
Log message for revision 28196:
Merge rev 28195 from trunk.
Now use ZODB.utils.z64 instead of '\0\0\0\0\0\0\0\0' where appropriate.
Changed:
U ZODB/branches/3.3/src/ZODB/BaseStorage.py
U ZODB/branches/3.3/src/ZODB/DB.py
U ZODB/branches/3.3/src/ZODB/DemoStorage.py
U ZODB/branches/3.3/src/ZODB/MappingStorage.py
U ZODB/branches/3.3/src/ZODB/dbmStorage.py
-=-
Modified: ZODB/branches/3.3/src/ZODB/BaseStorage.py
===================================================================
--- ZODB/branches/3.3/src/ZODB/BaseStorage.py 2004-10-15 11:28:41 UTC (rev 28195)
+++ ZODB/branches/3.3/src/ZODB/BaseStorage.py 2004-10-15 11:38:38 UTC (rev 28196)
@@ -25,6 +25,7 @@
from persistent.TimeStamp import TimeStamp
from ZODB import POSException, utils
+from ZODB.utils import z64
from ZODB.UndoLogCompatible import UndoLogCompatible
log = logging.getLogger("ZODB.BaseStorage")
@@ -98,7 +99,7 @@
t=self._ts=apply(TimeStamp,(time.gmtime(t)[:5]+(t%60,)))
self._tid = `t`
if base is None:
- self._oid='\0\0\0\0\0\0\0\0'
+ self._oid=z64
else:
self._oid=base._oid
Modified: ZODB/branches/3.3/src/ZODB/DB.py
===================================================================
--- ZODB/branches/3.3/src/ZODB/DB.py 2004-10-15 11:28:41 UTC (rev 28195)
+++ ZODB/branches/3.3/src/ZODB/DB.py 2004-10-15 11:38:38 UTC (rev 28196)
@@ -22,6 +22,7 @@
import logging
from ZODB.broken import find_global
+from ZODB.utils import z64
from ZODB.Connection import Connection
from ZODB.serialize import referencesf
@@ -124,7 +125,7 @@
if not hasattr(storage,'tpc_vote'):
storage.tpc_vote = lambda *args: None
try:
- storage.load('\0\0\0\0\0\0\0\0','')
+ storage.load(z64,'')
except KeyError:
# Create the database's root in the storage if it doesn't exist
from persistent.mapping import PersistentMapping
@@ -138,7 +139,7 @@
t = transaction.Transaction()
t.description = 'initial database creation'
storage.tpc_begin(t)
- storage.store('\0\0\0\0\0\0\0\0', None, file.getvalue(), '', t)
+ storage.store(z64, None, file.getvalue(), '', t)
storage.tpc_vote(t)
storage.tpc_finish(t)
Modified: ZODB/branches/3.3/src/ZODB/DemoStorage.py
===================================================================
--- ZODB/branches/3.3/src/ZODB/DemoStorage.py 2004-10-15 11:28:41 UTC (rev 28195)
+++ ZODB/branches/3.3/src/ZODB/DemoStorage.py 2004-10-15 11:38:38 UTC (rev 28196)
@@ -82,6 +82,7 @@
import base64, time, string
from ZODB import POSException, BaseStorage, utils
+from ZODB.utils import z64
from persistent.TimeStamp import TimeStamp
from cPickle import loads
from BTrees import OOBTree
@@ -409,7 +410,7 @@
# Now build an index of *only* those objects reachable
# from the root.
- rootl = ['\0\0\0\0\0\0\0\0']
+ rootl = [z64]
pindex = {}
while rootl:
oid = rootl.pop()
Modified: ZODB/branches/3.3/src/ZODB/MappingStorage.py
===================================================================
--- ZODB/branches/3.3/src/ZODB/MappingStorage.py 2004-10-15 11:28:41 UTC (rev 28195)
+++ ZODB/branches/3.3/src/ZODB/MappingStorage.py 2004-10-15 11:38:38 UTC (rev 28196)
@@ -21,7 +21,7 @@
The Mapping storage uses a single data structure to map object ids to data.
"""
-from ZODB import utils
+from ZODB.utils import u64, z64
from ZODB import BaseStorage
from ZODB import POSException
from persistent.TimeStamp import TimeStamp
@@ -115,7 +115,7 @@
if not self._index:
return
# Build an index of *only* those objects reachable from the root.
- rootl = ['\0\0\0\0\0\0\0\0']
+ rootl = [z64]
pindex = {}
while rootl:
oid = rootl.pop()
@@ -144,6 +144,6 @@
for oid in keys:
r = self._index[oid]
o.append(' %s: %s, %s' %
- (utils.u64(oid),TimeStamp(r[:8]),`r[8:]`))
+ (u64(oid),TimeStamp(r[:8]),`r[8:]`))
return '\n'.join(o)
Modified: ZODB/branches/3.3/src/ZODB/dbmStorage.py
===================================================================
--- ZODB/branches/3.3/src/ZODB/dbmStorage.py 2004-10-15 11:28:41 UTC (rev 28195)
+++ ZODB/branches/3.3/src/ZODB/dbmStorage.py 2004-10-15 11:38:38 UTC (rev 28196)
@@ -19,6 +19,8 @@
in undo or versions.
"""
+from ZODB.utils import z64
+
from MappingStorage import MappingStorage
from BaseStorage import BaseStorage
import anydbm, os
@@ -56,7 +58,7 @@
self._index=index=gdbm.open(filename, flag[:1]+'f', mode)
self._tindex=[]
- m='\0\0\0\0\0\0\0\0'
+ m=z64
oid=index.firstkey()
while oid != None:
m=max(m, oid)
@@ -76,7 +78,7 @@
# Build an index of *only* those objects reachable
# from the root.
index=self._index
- rootl=['\0\0\0\0\0\0\0\0']
+ rootl=[z64]
pop=rootl.pop
pindex={}
referenced=pindex.has_key
More information about the Zodb-checkins
mailing list