Commit a90f9ad4 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent f82ee6e2
...@@ -159,9 +159,6 @@ class tDB: ...@@ -159,9 +159,6 @@ class tDB:
t._headv = [] # XXX -> just use dFtail[·].rev ? t._headv = [] # XXX -> just use dFtail[·].rev ?
t.dFtail = [] # of DF t.dFtail = [] # of DF
# number of commits made so far
t.ncommit = 0
# fh(.wcfs/zhead) + history of zhead read from there # fh(.wcfs/zhead) + history of zhead read from there
t._wc_zheadfh = open(t.wc.mountpoint + "/.wcfs/zhead") t._wc_zheadfh = open(t.wc.mountpoint + "/.wcfs/zhead")
t._wc_zheadv = [] t._wc_zheadv = []
...@@ -224,10 +221,9 @@ class tDB: ...@@ -224,10 +221,9 @@ class tDB:
transaction.commit() transaction.commit()
head = last._p_serial head = last._p_serial
print('commit -> @%s\t# @at%d' % (h(head), t.ncommit))
t.ncommit += 1
t.head = head t.head = head
t._headv.append(head) t._headv.append(head)
print('commit -> %s' % t.hat(head))
dF.rev = head dF.rev = head
for dfile in dF.byfile.values(): for dfile in dF.byfile.values():
...@@ -590,9 +586,6 @@ def test_wcfs(): ...@@ -590,9 +586,6 @@ def test_wcfs():
t.root['zfile'] = zf = ZBigFile(blksize) t.root['zfile'] = zf = ZBigFile(blksize)
at0 = t.commit() at0 = t.commit()
t.ncommit = 0 # so that atX in the code correspond with debug output
at0_ = t.commit()
assert tidtime(at0_) > tidtime(at0)
# >>> lookup non-BigFile -> must be rejected # >>> lookup non-BigFile -> must be rejected
with raises(OSError) as exc: with raises(OSError) as exc:
...@@ -793,3 +786,11 @@ def tidtime(tid): ...@@ -793,3 +786,11 @@ def tidtime(tid):
# #
# NOTE pytest.approx supports only ==, not e.g. <, so we use plain round. # NOTE pytest.approx supports only ==, not e.g. <, so we use plain round.
return round(t, 6) return round(t, 6)
def test_tidtime_notrough():
t = tDB()
defer(t.close)
at0 = t.commit()
at1 = t.commit()
assert tidtime(at1) > tidtime(at0)
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