Commit 7dbddf9d authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 735125a1
......@@ -54,6 +54,7 @@ from wendelin.wcfs.internal import xbtree
from wendelin.bigfile.file_zodb import ZBlk
from zodbtools.util import storageFromURL
from persistent.mapping import PersistentMapping
import BTrees.LOBTree
......@@ -128,7 +129,7 @@ def treedeltaGenAllStructs(zstor, kv1txt, kv2txt, n):
# root['treedelta/values'] = {} v -> ZBlk(v)
valdict = root.setdefault('treedelta/values', {})
valdict = root['treedelta/values'] = PersistentMapping()
for v in b'abcdefghi':
# XXX don't ovewrite if already set?
zblk = ZBlk()
......@@ -151,8 +152,8 @@ def treedeltaGenAllStructs(zstor, kv1txt, kv2txt, n):
diff12 = diff(kv1, kv2) # of (k,v) diff to go from kv1 to kv2
diff21 = diff(kv2, kv1) # of (k,v) diff to go from kv2 to kv1
print('diff12:', diff12)
print('diff21:', diff21)
#print('diff12:', diff12)
#print('diff21:', diff21)
maxdepth=2 # XXX -> 3?
maxsplit=1 # XXX -> 2?
......@@ -160,7 +161,7 @@ def treedeltaGenAllStructs(zstor, kv1txt, kv2txt, n):
t2AllStructs = list(xbtree.AllStructs(kv2.keys(), maxdepth, maxsplit))
# emit initial kv1 state prepared as ZODB would natively
ztree = valdict['treedelta/tree'] = BTrees.LOBTree.LOBTree() # XXX -> XLOTree (small nodes)
ztree = root['treedelta/tree'] = BTrees.LOBTree.LOBTree() # XXX -> XLOTree (small nodes)
for k in sorted(kv1):
ztree[k] = kv1[k]
transaction.commit()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment