Commit f125140a authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent f64ed714
......@@ -377,9 +377,10 @@ class tDB:
yield ([dF.rev] + tail)
# _blkData returns expected zf[blk] data and revision as of @at database state.
# XXX ret for blk does not exists?
# XXX kill at=None?
def _blkData(t, zf, blk, at=None): # -> (data, rev)
#
# If the block is hole (b'', at0) is returned. XXX -> @z64?
# XXX ret for when the file did not existed at all? blk was after file size?
def _blkData(t, zf, blk, at): # -> (data, rev)
if at is None:
at = t.head
......@@ -393,7 +394,7 @@ class tDB:
if len(blkhistoryat) == 0:
# blk did not existed @at # XXX verify whether file was existing at all
data = b''
rev = None
rev = t._headv[0] # was hole - at0 XXX -> pin to z64
else:
_ = blkhistoryat[-1]
data = _.ddata[blk]
......@@ -402,7 +403,7 @@ class tDB:
return data, rev
# _blkRev returns expected zf[blk] revision as of @at database state?
# _blkRev returns expected zf[blk] revision as of @at database state.
def _blkRev(t, zf, blk, at): # -> rev
_, rev = t._blkData(zf, blk, at)
return rev
......@@ -864,6 +865,8 @@ class tSrvReq:
def _pinAt(twlink, zf, at): # -> pin = {} blk -> rev
t = twlink.tdb
# XXX dup in _blkData
# all changes to zf
vdf = [_.byfile[zf] for _ in t.dFtail if zf in _.byfile]
......@@ -876,7 +879,7 @@ def _pinAt(twlink, zf, at): # -> pin = {} blk -> rev
# history of blk changes <= at
blkhistoryat = [_.rev for _ in vdf if blk in _.ddata and _.rev <= at]
if len(blkhistoryat) == 0:
pinrev = t._headv[0] # was hole - at0 XXX -> pin to @00?
pinrev = t._headv[0] # was hole - at0 XXX -> pin to z64?
else:
pinrev = blkhistoryat[-1]
assert pinrev <= 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