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
4b5d1ba1
Commit
4b5d1ba1
authored
May 26, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
46509a57
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
wcfs/internal/xbtree.py
wcfs/internal/xbtree.py
+3
-2
wcfs/internal/xbtree_test.py
wcfs/internal/xbtree_test.py
+3
-1
No files found.
wcfs/internal/xbtree.py
View file @
4b5d1ba1
...
...
@@ -249,7 +249,8 @@ def StructureOf(znode, onlyKeys=False):
# Restructure reorganizes ZODB BTree instance (not Tree) according to specified
# topology structure.
#
# The new structure should be given with key-only buckets.
# The new structure should be usually given with key-only buckets.
# If new structure comes with values, values associated with keys must not be changed.
#
# NOTE ZODB BTree package does not tolerate structures with empty BTree nodes
# except for the sole single case of empty tree.
...
...
@@ -498,7 +499,7 @@ def Restructure(ztree, newStructure):
assert
len
(
node
.
keyv
)
==
len
(
node
.
valuev
)
for
(
k
,
v
)
in
zip
(
node
.
keyv
,
node
.
valuev
):
if
kv
[
k
]
is
not
v
:
raise
ValueError
(
"target bucket changes [%d] %r -> %r"
,
k
,
kv
[
k
],
v
)
raise
ValueError
(
"target bucket changes [%d] %r -> %r"
%
(
k
,
kv
[
k
],
v
)
)
zstate
=
()
for
k
in
node
.
keyv
:
...
...
wcfs/internal/xbtree_test.py
View file @
4b5d1ba1
...
...
@@ -687,7 +687,9 @@ def test_restructure():
assert
b0
[
0
]
is
X
[
0
]
assert
b2
[
2
]
is
X
[
2
]
# XXX raises if k->v different
# [2] changes value from X[2] to X[3]
with
raises
(
ValueError
,
match
=
r"target bucket changes \
[
2\
]
"):
R(z, T([1], Bv([0],X[0]), Bv([2],X[3])))
# ---- tricky cases
...
...
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