Commit 73abafd0 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent b411ca3b
......@@ -586,6 +586,7 @@ class tFile:
# tWatch represents watch for one file setup on a tWatchLink.
class tWatch:
def __init__(w, zfile):
assert isinstance(zfile, ZBigFile)
w.foid = zfile._p_oid
w.at = z64 # not None - always concrete
w.pinned = {} # blk -> rev
......@@ -829,23 +830,7 @@ class tSrvReq:
def at(req): return req._parse()[2]
# ---- query dFtail/accessed ----
# iter_revv iterates through all possible at_i -> at_j -> at_k ... sequences.
# at_i < at_j NOTE all sequences go till head.
@func(tDB)
def iter_revv(t, start=z64, level=0):
dFtail = [_ for _ in t.dFtail if _.rev > start]
#print(' '*level, 'iter_revv', t.hat(start), [t.hat(_.rev) for _ in dFtail])
if len(dFtail) == 0:
yield []
return
for dF in dFtail:
#print(' '*level, 'QQQ', t.hat(dF.rev))
for tail in t.iter_revv(start=dF.rev, level=level+1):
#print(' '*level, 'zzz', tail)
yield ([dF.rev] + tail)
# ---- helpers to query dFtail/accessed history ----
# _blkData returns expected zf[blk] data and revision as of @at database state.
#
......@@ -930,6 +915,22 @@ def _pinAt(t, zf, at): # -> pin = {} blk -> rev
return pin
# iter_revv iterates through all possible at_i -> at_j -> at_k ... sequences.
# at_i < at_j NOTE all sequences go till head.
@func(tDB)
def iter_revv(t, start=z64, level=0):
dFtail = [_ for _ in t.dFtail if _.rev > start]
#print(' '*level, 'iter_revv', t.hat(start), [t.hat(_.rev) for _ in dFtail])
if len(dFtail) == 0:
yield []
return
for dF in dFtail:
#print(' '*level, 'QQQ', t.hat(dF.rev))
for tail in t.iter_revv(start=dF.rev, level=level+1):
#print(' '*level, 'zzz', tail)
yield ([dF.rev] + tail)
# ---- watch setup/adjust ----
# watch sets up or adjusts a watch for file@at.
......
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