Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
f125140a
Commit
f125140a
authored
Jun 10, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
f64ed714
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+9
-6
No files found.
wcfs/wcfs_test.py
View file @
f125140a
...
@@ -377,9 +377,10 @@ class tDB:
...
@@ -377,9 +377,10 @@ class tDB:
yield
([
dF
.
rev
]
+
tail
)
yield
([
dF
.
rev
]
+
tail
)
# _blkData returns expected zf[blk] data and revision as of @at database state.
# _blkData returns expected zf[blk] data and revision as of @at database state.
# XXX ret for blk does not exists?
#
# XXX kill at=None?
# If the block is hole (b'', at0) is returned. XXX -> @z64?
def
_blkData
(
t
,
zf
,
blk
,
at
=
None
):
# -> (data, rev)
# 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
:
if
at
is
None
:
at
=
t
.
head
at
=
t
.
head
...
@@ -393,7 +394,7 @@ class tDB:
...
@@ -393,7 +394,7 @@ class tDB:
if
len
(
blkhistoryat
)
==
0
:
if
len
(
blkhistoryat
)
==
0
:
# blk did not existed @at # XXX verify whether file was existing at all
# blk did not existed @at # XXX verify whether file was existing at all
data
=
b''
data
=
b''
rev
=
None
rev
=
t
.
_headv
[
0
]
# was hole - at0 XXX -> pin to z64
else
:
else
:
_
=
blkhistoryat
[
-
1
]
_
=
blkhistoryat
[
-
1
]
data
=
_
.
ddata
[
blk
]
data
=
_
.
ddata
[
blk
]
...
@@ -402,7 +403,7 @@ class tDB:
...
@@ -402,7 +403,7 @@ class tDB:
return
data
,
rev
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
def
_blkRev
(
t
,
zf
,
blk
,
at
):
# -> rev
_
,
rev
=
t
.
_blkData
(
zf
,
blk
,
at
)
_
,
rev
=
t
.
_blkData
(
zf
,
blk
,
at
)
return
rev
return
rev
...
@@ -864,6 +865,8 @@ class tSrvReq:
...
@@ -864,6 +865,8 @@ class tSrvReq:
def
_pinAt
(
twlink
,
zf
,
at
):
# -> pin = {} blk -> rev
def
_pinAt
(
twlink
,
zf
,
at
):
# -> pin = {} blk -> rev
t
=
twlink
.
tdb
t
=
twlink
.
tdb
# XXX dup in _blkData
# all changes to zf
# all changes to zf
vdf
=
[
_
.
byfile
[
zf
]
for
_
in
t
.
dFtail
if
zf
in
_
.
byfile
]
vdf
=
[
_
.
byfile
[
zf
]
for
_
in
t
.
dFtail
if
zf
in
_
.
byfile
]
...
@@ -876,7 +879,7 @@ def _pinAt(twlink, zf, at): # -> pin = {} blk -> rev
...
@@ -876,7 +879,7 @@ def _pinAt(twlink, zf, at): # -> pin = {} blk -> rev
# history of blk changes <= at
# history of blk changes <= at
blkhistoryat
=
[
_
.
rev
for
_
in
vdf
if
blk
in
_
.
ddata
and
_
.
rev
<=
at
]
blkhistoryat
=
[
_
.
rev
for
_
in
vdf
if
blk
in
_
.
ddata
and
_
.
rev
<=
at
]
if
len
(
blkhistoryat
)
==
0
:
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
:
else
:
pinrev
=
blkhistoryat
[
-
1
]
pinrev
=
blkhistoryat
[
-
1
]
assert
pinrev
<=
at
assert
pinrev
<=
at
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment