Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
7dbddf9d
Commit
7dbddf9d
authored
May 21, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
735125a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
wcfs/testprog/treedelta-genallstructs.py
wcfs/testprog/treedelta-genallstructs.py
+5
-4
No files found.
wcfs/testprog/treedelta-genallstructs.py
View file @
7dbddf9d
...
...
@@ -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
=
valdic
t
[
'treedelta/tree'
]
=
BTrees
.
LOBTree
.
LOBTree
()
# XXX -> XLOTree (small nodes)
ztree
=
roo
t
[
'treedelta/tree'
]
=
BTrees
.
LOBTree
.
LOBTree
()
# XXX -> XLOTree (small nodes)
for
k
in
sorted
(
kv1
):
ztree
[
k
]
=
kv1
[
k
]
transaction
.
commit
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment