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
73abafd0
Commit
73abafd0
authored
Jun 21, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
b411ca3b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
17 deletions
+18
-17
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+18
-17
No files found.
wcfs/wcfs_test.py
View file @
73abafd0
...
...
@@ -586,6 +586,7 @@ class tFile:
# tWatch represents watch for one file setup on a tWatchLink.
class
tWatch
:
def
__init__
(
w
,
zfile
):
assert
isinstance
(
zfile
,
ZBigFile
)
w
.
foid
=
zfile
.
_p_oid
w
.
at
=
z64
# not None - always concrete
w
.
pinned
=
{}
# blk -> rev
...
...
@@ -829,23 +830,7 @@ class tSrvReq:
def
at
(
req
):
return
req
.
_parse
()[
2
]
# ---- query dFtail/accessed ----
# iter_revv iterates through all possible at_i -> at_j -> at_k ... sequences.
# at_i < at_j NOTE all sequences go till head.
@
func
(
tDB
)
def
iter_revv
(
t
,
start
=
z64
,
level
=
0
):
dFtail
=
[
_
for
_
in
t
.
dFtail
if
_
.
rev
>
start
]
#print(' '*level, 'iter_revv', t.hat(start), [t.hat(_.rev) for _ in dFtail])
if
len
(
dFtail
)
==
0
:
yield
[]
return
for
dF
in
dFtail
:
#print(' '*level, 'QQQ', t.hat(dF.rev))
for
tail
in
t
.
iter_revv
(
start
=
dF
.
rev
,
level
=
level
+
1
):
#print(' '*level, 'zzz', tail)
yield
([
dF
.
rev
]
+
tail
)
# ---- helpers to query dFtail/accessed history ----
# _blkData returns expected zf[blk] data and revision as of @at database state.
#
...
...
@@ -930,6 +915,22 @@ def _pinAt(t, zf, at): # -> pin = {} blk -> rev
return
pin
# iter_revv iterates through all possible at_i -> at_j -> at_k ... sequences.
# at_i < at_j NOTE all sequences go till head.
@
func
(
tDB
)
def
iter_revv
(
t
,
start
=
z64
,
level
=
0
):
dFtail
=
[
_
for
_
in
t
.
dFtail
if
_
.
rev
>
start
]
#print(' '*level, 'iter_revv', t.hat(start), [t.hat(_.rev) for _ in dFtail])
if
len
(
dFtail
)
==
0
:
yield
[]
return
for
dF
in
dFtail
:
#print(' '*level, 'QQQ', t.hat(dF.rev))
for
tail
in
t
.
iter_revv
(
start
=
dF
.
rev
,
level
=
level
+
1
):
#print(' '*level, 'zzz', tail)
yield
([
dF
.
rev
]
+
tail
)
# ---- watch setup/adjust ----
# watch sets up or adjusts a watch for file@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