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
e514617a
Commit
e514617a
authored
May 22, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
a5130f26
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
wcfs/testprog/treedelta-genallstructs.py
wcfs/testprog/treedelta-genallstructs.py
+14
-3
No files found.
wcfs/testprog/treedelta-genallstructs.py
View file @
e514617a
...
...
@@ -47,13 +47,15 @@ import sys
from
golang
import
func
,
defer
,
panic
from
golang
import
time
from
ZODB
import
DB
from
ZODB.Connection
import
Connection
import
transaction
import
random
from
wendelin.wcfs.internal
import
xbtree
from
wendelin.bigfile.file_zodb
import
ZBlk
from
zodbtools.util
import
storageFromURL
from
zodbtools.util
import
storageFromURL
,
ashex
from
persistent
import
CHANGED
from
persistent.mapping
import
PersistentMapping
import
BTrees.LOBTree
...
...
@@ -119,7 +121,16 @@ def patch(d, diff, verify):
def
commit
(
description
):
txn
=
transaction
.
get
()
txn
.
description
=
description
# XXX hack to retrieve committed transaction ID via ._p_serial of object changed in this transaction
assert
len
(
txn
.
_resources
)
==
1
zconn
=
txn
.
_resources
[
0
]
assert
isinstance
(
zconn
,
Connection
)
assert
len
(
zconn
.
_added
)
>
0
k
=
set
(
zconn
.
_added
.
keys
()).
pop
()
obj
=
zconn
.
_added
[
k
]
assert
obj
.
_p_state
==
CHANGED
txn
.
commit
()
return
obj
.
_p_serial
# treetxt returns text representation of a tree.
...
...
@@ -212,8 +223,8 @@ def treedeltaGenAllStructs(zstor, kv1txt, kv2txt, n):
xbtree
.
Restructure
(
ztree
,
tstruct
)
ttxt_prev
=
ttxt
ttxt
=
treetxt
(
ztree
)
commit
(
'%s -> %s'
%
(
ttxt_prev
,
ttxt
))
# XXX printδ
tid
=
commit
(
'%s -> %s'
%
(
ttxt_prev
,
ttxt
))
print
(
'txn %s # %s -> %s'
%
(
ashex
(
tid
),
ttxt_prev
,
ttxt
))
...
...
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