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
59c83009
Commit
59c83009
authored
Jul 09, 2021
by
Kirill Smelkov
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
X ΔFtail.SliceByFileRoot tests started to work draftly after "on-the-fly" rework
parent
2e673d9f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
wcfs/internal/zdata/δftail.go
wcfs/internal/zdata/δftail.go
+7
-1
wcfs/internal/zdata/δftail_test.go
wcfs/internal/zdata/δftail_test.go
+11
-1
No files found.
wcfs/internal/zdata/δftail.go
View file @
59c83009
...
@@ -393,6 +393,7 @@ func (δFtail *ΔFtail) ForgetPast(revCut zodb.Tid) {
...
@@ -393,6 +393,7 @@ func (δFtail *ΔFtail) ForgetPast(revCut zodb.Tid) {
//
//
// Note: contrary to regular go slicing, low is exclusive while high is inclusive.
// Note: contrary to regular go slicing, low is exclusive while high is inclusive.
func
(
δFtail
*
ΔFtail
)
SliceByFileRev
(
zfile
*
ZBigFile
,
lo
,
hi
zodb
.
Tid
)
/*readonly*/
[]
*
ΔFile
{
func
(
δFtail
*
ΔFtail
)
SliceByFileRev
(
zfile
*
ZBigFile
,
lo
,
hi
zodb
.
Tid
)
/*readonly*/
[]
*
ΔFile
{
//fmt.Printf("\n")
xtail
.
AssertSlice
(
δFtail
,
lo
,
hi
)
xtail
.
AssertSlice
(
δFtail
,
lo
,
hi
)
// XXX locking
// XXX locking
...
@@ -456,7 +457,10 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
...
@@ -456,7 +457,10 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
}
else
{
}
else
{
ZinblkAt
=
lo
ZinblkAt
=
lo
}
}
// it--
// XXX hack - should be in ΔBtail.SliceByRevRoot
if
ZinblkAt
<=
lo
{
it
=
-
1
// don't go down beyond that
}
iz
:=
len
(
vδZ
)
-
1
iz
:=
len
(
vδZ
)
-
1
for
(
iz
>=
0
||
it
>=
0
)
{
for
(
iz
>=
0
||
it
>=
0
)
{
...
@@ -465,6 +469,7 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
...
@@ -465,6 +469,7 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
if
iz
>=
0
{
if
iz
>=
0
{
δZ
:=
vδZ
[
iz
]
δZ
:=
vδZ
[
iz
]
if
ZinblkAt
<=
δZ
.
Rev
{
if
ZinblkAt
<=
δZ
.
Rev
{
//fmt.Printf("δZ @%s\n", δZ.Rev)
for
_
,
oid
:=
range
δZ
.
Changev
{
for
_
,
oid
:=
range
δZ
.
Changev
{
inblk
,
ok
:=
Zinblk
[
oid
]
inblk
,
ok
:=
Zinblk
[
oid
]
if
ok
&&
len
(
inblk
)
!=
0
{
if
ok
&&
len
(
inblk
)
!=
0
{
...
@@ -480,6 +485,7 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
...
@@ -480,6 +485,7 @@ func (δFtail *ΔFtail) SliceByFileRev(zfile *ZBigFile, lo, hi zodb.Tid) /*reado
// δT -> adjust Zinblk + update δf
// δT -> adjust Zinblk + update δf
if
it
>=
0
{
if
it
>=
0
{
δT
:=
vδT
[
it
]
δT
:=
vδT
[
it
]
//fmt.Printf("δT @%s\n", δT.Rev)
for
blk
,
δzblk
:=
range
δT
.
ΔKV
{
for
blk
,
δzblk
:=
range
δT
.
ΔKV
{
// apply in reverse as we go ←
// apply in reverse as we go ←
if
δzblk
.
New
!=
xbtree
.
VDEL
{
if
δzblk
.
New
!=
xbtree
.
VDEL
{
...
...
wcfs/internal/zdata/δftail_test.go
View file @
59c83009
...
@@ -308,8 +308,18 @@ func TestΔFtail(t *testing.T) {
...
@@ -308,8 +308,18 @@ func TestΔFtail(t *testing.T) {
// XXX more
// XXX more
// found by TestΔFtailRandom
// ---- found by TestΔFtailRandom ----
{
δT
{
1
:
a
,
6
:
i
,
7
:
d
,
8
:
e
},
δD
(
a
,
c
,
e
,
f
,
g
,
h
,
i
,
j
)},
{
δT
{
1
:
a
,
6
:
i
,
7
:
d
,
8
:
e
},
δD
(
a
,
c
,
e
,
f
,
g
,
h
,
i
,
j
)},
// was including <= lo entries in SliceByFileRev
{
δT
{
0
:
b
,
2
:
j
,
3
:
i
,
5
:
f
,
6
:
b
,
7
:
i
,
8
:
d
},
δD
(
a
,
b
,
c
,
d
,
e
,
g
,
i
,
j
)},
{
δT
{
0
:
e
,
2
:
h
,
4
:
d
,
9
:
b
},
δD
(
a
,
h
,
i
)},
{
δT
{
0
:
j
,
1
:
i
,
3
:
g
,
5
:
a
,
6
:
e
,
7
:
j
,
8
:
f
,
9
:
d
},
δD
()},
{
δT
{
0
:
b
,
1
:
f
,
2
:
h
,
4
:
b
,
8
:
b
},
δD
(
b
,
d
,
i
)},
{
δT
{
1
:
a
,
3
:
d
,
6
:
j
},
δD
(
b
,
c
,
d
,
f
,
g
,
h
,
i
,
j
)},
{
δT
{
0
:
i
,
1
:
f
,
4
:
e
,
5
:
e
,
7
:
d
,
8
:
h
},
δD
(
d
,
j
)},
{
δT
{},
δD
(
a
,
b
,
c
,
e
,
f
,
g
,
h
,
i
,
j
)},
}
}
testq
:=
make
(
chan
ΔFTestEntry
)
testq
:=
make
(
chan
ΔFTestEntry
)
...
...
Kirill Smelkov
@kirr
mentioned in commit
23d8da82
·
Oct 27, 2021
mentioned in commit
23d8da82
mentioned in commit 23d8da82b89134b00ae8dafeb0a5c7348dd8b4fe
Toggle commit list
Kirill Smelkov
@kirr
mentioned in commit
f980471f
·
Oct 28, 2021
mentioned in commit
f980471f
mentioned in commit f980471f6bd466f7da6fbe6753a7a14b1d3c8151
Toggle commit list
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