Commit f80b498d authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent d9c07dff
......@@ -730,11 +730,13 @@ def _pinAt(twlink, zf, at): # -> pin = {} blk -> rev
return pin
# watch sets up a watch for file@at.
# XXX and verifies that wcfs sends correct initial pins?
# XXX or adjusts
# watch sets up or adjusts a watch for file@at.
#
# During setup it verifies that wcfs sends correct initial pins.
#
# pinok can be None - in that case it is computed automatically.
@func(tWatchLink)
def watch(twlink, zf, at): # XXX -> ?
def watch(twlink, zf, at, pinok=None): # XXX -> ?
t = twlink.tdb
at_prev = twlink._watching.get(zf) # we were previously watching zf @at_prev
at_from = ''
......@@ -786,6 +788,8 @@ def watch(twlink, zf, at): # XXX -> ?
# {} blk -> at that have to be pinned.
# XXX also check that head/file[blk] is in cache - else no need to pin
if pinok is not None:
assert pinok == pin, "explicit pinok != computed pinok"
pinok = pin
print('# pinok: %s' % pinstr(pinok))
......@@ -952,11 +956,11 @@ def test_wcfs():
# f @at2
f2.assertCache([0,0,1,0])
f2.assertData (['','','2c','2d']) # XXX mtime=at2
f2.assertData (['','','2c','2d']) # XXX mtime=at2?
# f @at1
f1.assertCache([1,1,1])
f1.assertData (['','','1cc']) # XXX + mtime=at1?
f1.assertData (['','','1cc']) # XXX + mtime=at1?
# >>> f close / open again -> cache must not be lost
......@@ -968,7 +972,7 @@ def test_wcfs():
# >>> XXX commit data to not yet accessed f part - nothing happens
"""
# """
# >>> invalidation protocol
print('\n\n inv. protocol \n\n')
......@@ -996,7 +1000,10 @@ def test_wcfs():
" head/at (@%s); …" % (h(zf._p_oid), h(atpast), h(t.head)))
wl.close()
# valid watch requests going at_i -> at_j -> ...
# some watch requests with explicit pinok
# XXX
# valid watch requests going at_i -> at_j -> ... with automatic pinok
for zf in t.zfiles():
for revv in t.iter_revv():
print('\n--------')
......@@ -1007,7 +1014,7 @@ def test_wcfs():
for at in revv[1:]:
wl.watch(zf, at)
wl.close()
"""
# """
print('\n\n\n\nWATCH+COMMIT\n\n\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