Commit 57322f77 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 1176b9b9
......@@ -177,17 +177,17 @@ def AllStructs(zstor, kv1txt, kv2txt, n, seed=None):
# emit patches ztree with delta, adjusts tree structure and emits corresponding commit.
def emit(delta, verify, treeTopo):
ttxt_prev = treetxt(ztree)
ttxt_prev = treetxt(ztree, zctx.vencode)
patch(ztree, delta, verify)
if treeTopo is not None:
xbtree.Restructure(ztree, treeTopo)
ttxt = treetxt(ztree)
ttxt = treetxt(ztree, zctx.vencode)
tid = commit('%s -> %s' % (ttxt_prev, ttxt))
print('txn %s # %s -> %s' % (ashex(tid), ttxt_prev, ttxt))
for (k,v) in delta:
vtxt = 'ø'
if v is not DEL:
vtxt = vencode(v)
vtxt = zctx.vencode(v)
# XXX print not only +, but also - (e.g. -1:a +1:b) ?
print('\t%d:%s' % (k,vtxt))
......@@ -320,8 +320,8 @@ def commit(description): # -> tid
# treetxt returns text representation of a tree.
def treetxt(ztree): # -> txt
return xbtree.TopoEncode(xbtree.StructureOf(ztree), vencode=lambda v:1/0) # FIXME include values
def treetxt(ztree, vencode): # -> txt
return xbtree.TopoEncode(xbtree.StructureOf(ztree), vencode)
@func
......
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