Commit 05952f40 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent b039f763
...@@ -520,15 +520,16 @@ class tFile: ...@@ -520,15 +520,16 @@ class tFile:
w = wlink._watching.get(t.zf) w = wlink._watching.get(t.zf)
if w is not None and w.at < blkrev: if w is not None and w.at < blkrev:
if cached == 1: if cached == 1:
# XXX assert blk already pinned on that watch # @head[blk].rev is after w.at - w[blk] must be already pinned
assert blk in w.pinned # XXX correct? assert blk in w.pinned
assert w.pinned[blk] <= w.at
else: else:
assert cached == 0 assert cached == 0
assert blk not in w.pinned # cache is cleared only on invalidations # even if @head[blk] is uncached, the block could be
# XXX correct ^^^ ? # already pinned by setup watch
# XXX and watch not already pinned on the watch if blk not in w.pinned:
pinok = {blk: t.tdb._blkRev(t.zf, blk, w.at)} pinok = {blk: t.tdb._blkRev(t.zf, blk, w.at)}
shouldPin = True shouldPin = True
wpin[wlink] = pinok wpin[wlink] = pinok
if pinokByWLink is not None: if pinokByWLink is not None:
...@@ -1144,7 +1145,7 @@ def test_wcfs(): ...@@ -1144,7 +1145,7 @@ def test_wcfs():
# >>> XXX commit data to not yet accessed f part - nothing happens # >>> XXX commit data to not yet accessed f part - nothing happens
# """ """
# >>> invalidation protocol # >>> invalidation protocol
print('\n\n inv. protocol \n\n') print('\n\n inv. protocol \n\n')
...@@ -1210,7 +1211,7 @@ def test_wcfs(): ...@@ -1210,7 +1211,7 @@ def test_wcfs():
for at in revv[1:]: for at in revv[1:]:
wl.watch(zf, at) wl.watch(zf, at)
wl.close() wl.close()
# """ """
# XXX move before setup watch? # XXX move before setup watch?
print('\n\n\n\nWATCH+COMMIT\n\n') print('\n\n\n\nWATCH+COMMIT\n\n')
......
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