Commit f82ee6e2 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent a7dde4cb
...@@ -285,6 +285,19 @@ class tDB: ...@@ -285,6 +285,19 @@ class tDB:
return open(path, mode, 0) # unbuffered return open(path, mode, 0) # unbuffered
# hat returns string for at.
# it gives both symbolic version and raw hex for at, for example:
# @at2 (03cf7850500b5f66)
def hat(t, at):
try:
i = t._headv.index(at)
except ValueError:
return "@" + h(at)
return "@at%d (%s)" % (i, h(at))
# tFile provides testing environment for one bigfile on wcfs. # tFile provides testing environment for one bigfile on wcfs.
# #
# .blk() provides access to data of a block. .cached() gives state of which # .blk() provides access to data of a block. .cached() gives state of which
...@@ -671,7 +684,7 @@ def test_wcfs(): ...@@ -671,7 +684,7 @@ def test_wcfs():
# checkSetupWatch verifies setting up new watch for zf@at. # checkSetupWatch verifies setting up new watch for zf@at.
def checkSetupWatch(zf, at): def checkSetupWatch(zf, at):
print('C: check setup watch f%s @%s' % (h(zf._p_oid), h(at))) print('C: check setup watch f%s %s' % (h(zf._p_oid), t.hat(at)))
# all changes to zf # all changes to zf
vdf = [_.byfile[zf] for _ in t.dFtail if zf in _.byfile] vdf = [_.byfile[zf] for _ in t.dFtail if zf in _.byfile]
...@@ -686,7 +699,7 @@ def test_wcfs(): ...@@ -686,7 +699,7 @@ def test_wcfs():
# history of blk changes <= at # history of blk changes <= at
blkhistoryat = [_.rev for _ in vdf if blk in _.ddata and _.rev <= at] blkhistoryat = [_.rev for _ in vdf if blk in _.ddata and _.rev <= at]
if len(blkhistoryat) == 0: if len(blkhistoryat) == 0:
pinrev = 0 # was hole XXX -> h64 pinrev = '\x00' # was hole XXX -> h64
else: else:
pinrev = max(blkhistoryat) pinrev = max(blkhistoryat)
pinok[blk] = pinrev pinok[blk] = pinrev
......
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