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
35d06867
Commit
35d06867
authored
May 14, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
c6785679
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
wcfs/internal/xbtree.py
wcfs/internal/xbtree.py
+13
-3
No files found.
wcfs/internal/xbtree.py
View file @
35d06867
...
...
@@ -410,11 +410,11 @@ def Restructure(ztree, newStructure):
# non-empty BTree".
zstate
=
unset
=
object
()
if
len
(
node
.
keyv
)
==
0
:
child
=
node
.
children
[
0
]
if
len
(
rlevelv
)
==
2
:
# only 2 levels
assert
len
(
rlevelv
[
0
])
==
1
# top-one has empty tree
assert
rlevelv
[
0
][
0
].
node
is
node
child
=
node
.
children
[
0
]
# bottom-on has 1 bucket
assert
isinstance
(
child
,
Bucket
)
assert
isinstance
(
child
,
Bucket
)
# bottom-on has 1 bucket
assert
len
(
rlevelv
[
1
])
==
1
assert
rlevelv
[
1
][
0
].
node
is
child
...
...
@@ -422,10 +422,20 @@ def Restructure(ztree, newStructure):
if
len
(
child
.
keyv
)
==
0
:
zstate
=
None
# tree with single bucket withou oid -> tree with embedded bucket
# tree with single bucket withou
t
oid -> tree with embedded bucket
elif
child
.
Z
.
_p_oid
is
None
:
zstate
=
((
child
.
Z
.
__getstate__
(),),)
# more than 2 levels. For .../T/B B._p_oid must be set - else
# T.__getstate__ will embed B instead of preserving what we
# pass into T.__setstate__
else
:
if
isinstance
(
child
,
Bucket
)
and
child
.
Z
.
_p_oid
is
None
:
if
ztree
.
_p_jar
is
None
:
raise
ValueError
(
"Cannot generate .../T/B topology not under ZODB connection"
)
ztree
.
_p_jar
.
add
(
child
.
Z
)
assert
child
.
Z
.
_p_oid
is
not
None
if
zstate
is
unset
:
# normal tree node
zstate
=
()
...
...
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