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
16f5dcaa
Commit
16f5dcaa
authored
Jul 15, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
ca77282e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+10
-8
No files found.
wcfs/wcfs_test.py
View file @
16f5dcaa
...
...
@@ -640,7 +640,7 @@ class tFile:
if
t
.
at
is
None
:
# @head/...
for
wlink
in
t
.
tdb
.
_wlinks
:
pinok
=
{}
w
=
wlink
.
_watching
.
get
(
t
.
zf
)
w
=
wlink
.
_watching
.
get
(
t
.
zf
.
_p_oid
)
if
w
is
not
None
and
w
.
at
<
blkrev
:
if
cached
==
1
:
# @head[blk].rev is after w.at - w[blk] must be already pinned
...
...
@@ -785,7 +785,7 @@ class tWatchLink:
t
.
_serveWG
.
go
(
t
.
_serveRX
)
# this tWatchLink currently watches the following files at particular state.
t
.
_watching
=
{}
# {}
ZBigFile -> tWatch XXX ZBigFile -> foid
t
.
_watching
=
{}
# {}
foid -> tWatch
tdb
.
_wlinks
.
add
(
t
)
...
...
@@ -1002,10 +1002,11 @@ class tSrvReq:
# pinok when it is present.
@
func
(
tWatchLink
)
def
watch
(
twlink
,
zf
,
at
,
pinok
=
None
):
# -> tWatch
foid
=
zf
.
_p_oid
t
=
twlink
.
tdb
w
=
twlink
.
_watching
.
get
(
zf
)
w
=
twlink
.
_watching
.
get
(
foid
)
if
w
is
None
:
w
=
twlink
.
_watching
[
zf
]
=
tWatch
(
zf
.
_p_
oid
)
w
=
twlink
.
_watching
[
foid
]
=
tWatch
(
f
oid
)
at_prev
=
None
else
:
at_prev
=
w
.
at
# we were previously watching zf @at_prev
...
...
@@ -1013,7 +1014,7 @@ def watch(twlink, zf, at, pinok=None): # -> tWatch
at_from
=
''
if
at_prev
is
not
None
:
at_from
=
'(%s ->) '
%
at_prev
print
(
'
\
n
C: setup watch f<%s> %s%s'
%
(
h
(
zf
.
_p_
oid
),
at_from
,
at
))
print
(
'
\
n
C: setup watch f<%s> %s%s'
%
(
h
(
f
oid
),
at_from
,
at
))
accessed
=
t
.
_blkaccessed
(
zf
)
lastRevOf
=
lambda
blk
:
t
.
_blkRevAt
(
zf
,
blk
,
t
.
head
)
...
...
@@ -1088,8 +1089,9 @@ def watch(twlink, zf, at, pinok=None): # -> tWatch
# stop_watch instructs wlink to stop watching the file.
@
func
(
tWatchLink
)
def
stop_watch
(
twlink
,
zf
):
assert
zf
in
twlink
.
_watching
w
=
twlink
.
_watching
.
pop
(
zf
)
foid
=
zf
.
_p_oid
assert
foid
in
twlink
.
_watching
w
=
twlink
.
_watching
.
pop
(
foid
)
twlink
.
_watch
(
zf
,
b"-"
,
{},
"ok"
)
w
.
at
=
z64
...
...
@@ -1142,7 +1144,7 @@ def doCheckingPin(f, pinokByWLink, pinfunc=None): # -> []event(str)
for
wlink
,
(
zf
,
pinok
)
in
pinokByWLink
.
items
():
def
_
(
ctx
,
wlink
,
zf
,
pinok
):
w
=
wlink
.
_watching
.
get
(
zf
)
w
=
wlink
.
_watching
.
get
(
zf
.
_p_oid
)
if
len
(
pinok
)
>
0
:
assert
w
is
not
None
...
...
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