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
b10e08f4
Commit
b10e08f4
authored
Jun 23, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
52eacf3d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+15
-6
No files found.
wcfs/wcfs_test.py
View file @
b10e08f4
...
...
@@ -878,6 +878,7 @@ def watch(twlink, zf, at, pinok=None): # -> tWatch
print
(
'
\
n
C: setup watch f<%s> %s%s'
%
(
h
(
zf
.
_p_oid
),
at_from
,
t
.
hat
(
at
)))
headOfAccess
=
t
.
_headOfAccess
(
zf
)
blkRevAt
=
lambda
blk
,
at
:
t
.
_blkRevAt
(
zf
,
blk
,
at
)
pin_prev
=
{}
if
at_prev
is
not
None
:
...
...
@@ -894,25 +895,33 @@ def watch(twlink, zf, at, pinok=None): # -> tWatch
# blk ∉ pin_prev, blk ∉ pin -> cannot happen
assert
(
blk
in
pin_prev
)
or
(
blk
in
pin
)
# blk ∉ pin_prev, blk ∈ pin -> cannot happen
# blk ∉ pin_prev, blk ∈ pin -> cannot happen
, except on first start
if
blk
not
in
pin_prev
and
blk
in
pin
:
if
at_prev
is
not
None
:
assert
False
,
'#%d pinned %s; not pinned %s'
%
(
t
.
hat
(
at_prev
),
t
.
hat
(
at
))
# blk ∈ pin -> blk was already accessed with rev > at
assert
blk
in
headOfAccess
assert
at
<
blkRevAt
(
blk
,
headOfAccess
[
blk
])
# blk ∈ pin_prev, blk ∉ pin -> unpin to head
elif
blk
in
pin_prev
and
blk
not
in
pin
:
# blk ∈ pin_prev
means
blk was already accessed with rev > at_prev
# blk ∈ pin_prev
->
blk was already accessed with rev > at_prev
assert
blk
in
headOfAccess
assert
t
.
_blkRevAt
(
blk
,
headOfAccess
[
blk
])
>
at_prev
assert
at_prev
<
blkRevAt
(
blk
,
headOfAccess
[
blk
])
# blk ∉ pin
means XXX
assert
headOfAccess
[
blk
]
>=
t
.
_blkRevAt
(
blk
,
t
.
head
)
# blk ∉ pin
-> blk revision as of last access is ≤ at
assert
blkRevAt
(
blk
,
headOfAccess
[
blk
])
<=
at
pin
[
blk
]
=
None
# @head
# blk ∈ pin_prev, blk ∈ pin -> if rev different: use pin
elif
blk
in
pin_prev
and
blk
in
pin
:
# XXX headOfAccess assert
# blk ∈ pin_prev, pin -> blk was already accessed with rev > at_prev, at
assert
blk
in
headOfAccess
assert
at_prev
<
blkRevAt
(
blk
,
headOfAccess
[
blk
])
assert
at
<
blkRevAt
(
blk
,
headOfAccess
[
blk
])
assert
pin_prev
[
blk
]
<=
pin
[
blk
]
if
pin_prev
[
blk
]
==
pin
[
blk
]:
del
pin
[
blk
]
# would need to pin to what it is already pinned
...
...
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