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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
wendelin.core
Commits
f80b498d
Commit
f80b498d
authored
Jun 07, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
d9c07dff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+16
-9
No files found.
wcfs/wcfs_test.py
View file @
f80b498d
...
...
@@ -730,11 +730,13 @@ def _pinAt(twlink, zf, at): # -> pin = {} blk -> rev
return
pin
# watch sets up a watch for file@at.
# XXX and verifies that wcfs sends correct initial pins?
# XXX or adjusts
# watch sets up or adjusts a watch for file@at.
#
# During setup it verifies that wcfs sends correct initial pins.
#
# pinok can be None - in that case it is computed automatically.
@
func
(
tWatchLink
)
def
watch
(
twlink
,
zf
,
at
):
# XXX -> ?
def
watch
(
twlink
,
zf
,
at
,
pinok
=
None
):
# XXX -> ?
t
=
twlink
.
tdb
at_prev
=
twlink
.
_watching
.
get
(
zf
)
# we were previously watching zf @at_prev
at_from
=
''
...
...
@@ -786,6 +788,8 @@ def watch(twlink, zf, at): # XXX -> ?
# {} 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
pinok
==
pin
,
"explicit pinok != computed pinok"
pinok
=
pin
print
(
'# pinok: %s'
%
pinstr
(
pinok
))
...
...
@@ -952,11 +956,11 @@ def test_wcfs():
# f @at2
f2
.
assertCache
([
0
,
0
,
1
,
0
])
f2
.
assertData
([
''
,
''
,
'2c'
,
'2d'
])
# XXX mtime=at2
f2
.
assertData
([
''
,
''
,
'2c'
,
'2d'
])
# XXX mtime=at2
?
# f @at1
f1
.
assertCache
([
1
,
1
,
1
])
f1
.
assertData
([
''
,
''
,
'1cc'
])
# XXX + mtime=at1?
f1
.
assertData
([
''
,
''
,
'1cc'
])
# XXX + mtime=at1?
# >>> f close / open again -> cache must not be lost
...
...
@@ -968,7 +972,7 @@ def test_wcfs():
# >>> XXX commit data to not yet accessed f part - nothing happens
"""
#
"""
# >>> invalidation protocol
print
(
'
\
n
\
n
inv. protocol
\
n
\
n
'
)
...
...
@@ -996,7 +1000,10 @@ def test_wcfs():
" head/at (@%s); …"
%
(
h
(
zf
.
_p_oid
),
h
(
atpast
),
h
(
t
.
head
)))
wl
.
close
()
# valid watch requests going at_i -> at_j -> ...
# some watch requests with explicit pinok
# XXX
# valid watch requests going at_i -> at_j -> ... with automatic pinok
for
zf
in
t
.
zfiles
():
for
revv
in
t
.
iter_revv
():
print
(
'
\
n
--------'
)
...
...
@@ -1007,7 +1014,7 @@ def test_wcfs():
for
at
in
revv
[
1
:]:
wl
.
watch
(
zf
,
at
)
wl
.
close
()
"""
#
"""
print
(
'
\
n
\
n
\
n
\
n
WATCH+COMMIT
\
n
\
n
\
n
\
n
'
)
...
...
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