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
22cb4a88
Commit
22cb4a88
authored
Jun 23, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
206b7ceb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
15 deletions
+17
-15
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+17
-15
No files found.
wcfs/wcfs_test.py
View file @
22cb4a88
...
...
@@ -864,17 +864,6 @@ def watch(twlink, zf, at, pinok=None): # XXX -> tWatch ?
at_from
=
'(%s ->) '
%
t
.
hat
(
at_prev
)
print
(
'
\
n
C: setup watch f<%s> %s%s'
%
(
h
(
zf
.
_p_oid
),
at_from
,
t
.
hat
(
at
)))
# pinstr returns human-readable representation for {}blk->rev
def
pinstr
(
pin
):
pinv
=
[]
for
blk
in
sorted
(
pin
.
keys
()):
if
pin
[
blk
]
is
None
:
s
=
'head'
else
:
s
=
t
.
hat
(
pin
[
blk
])
pinv
.
append
(
'%d: %s'
%
(
blk
,
s
))
return
'{%s}'
%
', '
.
join
(
pinv
)
pin_prev
=
{}
if
at_prev
is
not
None
:
assert
at_prev
<=
at
,
'TODO %s -> %s'
%
(
t
.
hat
(
at_prev
),
t
.
hat
(
at
))
...
...
@@ -884,7 +873,7 @@ def watch(twlink, zf, at, pinok=None): # XXX -> tWatch ?
pin
=
t
.
_needPinAt
(
zf
,
at
)
if
at_prev
!=
at
and
at_prev
is
not
None
:
print
(
'# pin@old: %s
\
n
# pin@new: %s'
%
(
pinstr
(
pin_prev
),
pinstr
(
pin
)))
print
(
'# pin@old: %s
\
n
# pin@new: %s'
%
(
t
.
hpin
(
pin_prev
),
t
.
hpin
(
pin
)))
for
blk
in
set
(
pin_prev
.
keys
()).
union
(
pin
.
keys
()):
# blk ∉ pin_prev, blk ∉ pin -> cannot happen
...
...
@@ -905,14 +894,14 @@ def watch(twlink, zf, at, pinok=None): # XXX -> tWatch ?
if
pin_prev
[
blk
]
==
pin
[
blk
]:
del
pin
[
blk
]
# would need to pin to what it is already pinned
#print('-> %s' %
pinstr
(pin))
#print('-> %s' %
t.hpin
(pin))
# {} 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
pin
==
pinok
,
"computed vs explicit pinok"
pinok
=
pin
print
(
'# pinok: %s'
%
pinstr
(
pinok
))
print
(
'# pinok: %s'
%
t
.
hpin
(
pinok
))
# send watch request and check that we receive pins for in-cache blocks
# changed > at. FIXME "in-cache" is currently not handled
...
...
@@ -1056,7 +1045,7 @@ def _expectPin(twlink, ctx, zf, expect): # -> []tSrvReq
# ---- infrastructure: helpers to query dFtail/accessed history ----
# _blkDataAt returns expected zf[blk] data and revision as of @at database state.
# _blkDataAt returns expected zf[blk] data and
its
revision as of @at database state.
#
# 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?
...
...
@@ -1505,6 +1494,19 @@ def hat(t, at):
return
"@"
+
h
(
at
)
# hpin returns human-readable representation for {}blk->rev.
@
func
(
tDB
)
def
hpin
(
t
,
pin
):
pinv
=
[]
for
blk
in
sorted
(
pin
.
keys
()):
if
pin
[
blk
]
is
None
:
s
=
'@head'
else
:
s
=
t
.
hat
(
pin
[
blk
])
pinv
.
append
(
'%d: %s'
%
(
blk
,
s
))
return
'{%s}'
%
', '
.
join
(
pinv
)
# zfiles returns ZBigFiles that were ever changed under t.
@
func
(
tDB
)
def
zfiles
(
t
):
...
...
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