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
a3af5a18
Commit
a3af5a18
authored
Jul 16, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
a7adc935
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
9 deletions
+28
-9
wcfs/internal/xbtree/δbtail.go
wcfs/internal/xbtree/δbtail.go
+1
-0
wcfs/internal/zdata/δftail_test.go
wcfs/internal/zdata/δftail_test.go
+27
-9
No files found.
wcfs/internal/xbtree/δbtail.go
View file @
a3af5a18
...
...
@@ -750,6 +750,7 @@ func (δBtail *ΔBtail) ForgetPast(revCut zodb.Tid) {
}
func
(
δTtail
*
ΔTtail
)
forgetPast
(
revCut
zodb
.
Tid
)
{
// XXX locking
// XXX lastRevOf
icut
:=
0
...
...
wcfs/internal/zdata/δftail_test.go
View file @
a3af5a18
...
...
@@ -192,6 +192,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
zroot
.
PDeactivate
()
foid
:=
zfile
.
POid
()
err
=
zfile
.
PActivate
(
ctx
);
X
(
err
)
blksize
:=
zfile
.
blksize
blktabOid
:=
zfile
.
blktab
.
POid
()
if
blktabOid
!=
t
.
Root
()
{
t
.
Fatalf
(
"BUG: zfile.blktab (%s) != treeroot (%s)"
,
blktabOid
,
t
.
Root
())
...
...
@@ -201,6 +202,8 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
// data built via applying changes from testv
vδf
:=
[]
*
ΔFile
{}
// (rev↑, {}blk)
//vδE := []_ΔFileEpoch{} // (rev↑, EPOCH)
var
vδE
[]
_ΔFileEpoch
// FIXME change to !nil (^^^) after ΔFtail.rebuild is added
blkTab
:=
map
[
int64
]
string
{}
// #blk -> ZBlk<name>
dataTab
:=
map
[
string
]
string
{}
// ZBlk<name> -> data
Zinblk
:=
map
[
string
]
setI64
{}
// ZBlk<name> -> which #blk refer to it
...
...
@@ -387,6 +390,21 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
}
vδf
=
append
(
vδf
,
δfok
)
}
if
newEpoch
{
δE
:=
_ΔFileEpoch
{
Rev
:
commit
.
At
}
if
delfile
{
δE
.
oldRoot
=
blktabOid
δE
.
newRoot
=
zodb
.
InvalidOid
δE
.
newBlkSize
=
-
1
// XXX oldBlkSize ?
}
else
{
δE
.
oldRoot
=
zodb
.
InvalidOid
δE
.
newRoot
=
blktabOid
δE
.
newBlkSize
=
blksize
// XXX oldBlkSize ?
}
vδE
=
append
(
vδE
,
δE
)
}
//fmt.Printf("Zinblk: %v\n", Zinblk)
...
...
@@ -452,19 +470,19 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
vδf
=
vδf
[
1
:
]
//t.Logf("# vδf: %s", vδfstr(vδf))
//t.Logf("# vδt: %s", vδfstr(δFtail.SliceByFileRev(zfile, δFtail.Tail(), δFtail.Head())))
icut
:=
0
;
for
;
icut
<
len
(
vδE
);
icut
++
{
if
vδE
[
icut
]
.
Rev
>
revcut
{
break
}
// verify vδE
//vδEok := []_ΔFileEpoch{}
var
vδEok
[]
_ΔFileEpoch
// FIXME change to !nil (^^^) after ΔFtail.rebuild is added
for
_
,
δf
:=
range
vδf
{
if
δf
.
Epoch
{
vδEok
=
append
(
vδEok
,
_ΔFileEpoch
{
Rev
:
δf
.
Rev
})
// XXX + root,size
}
vδE
=
vδE
[
icut
:
]
}
// verify vδE
δftail
:=
δFtail
.
byFile
[
foid
]
if
!
reflect
.
DeepEqual
(
δftail
.
vδE
,
vδE
ok
)
{
t
.
Errorf
(
"vδE:
\n
have: %v
\n
want: %v"
,
δftail
.
vδE
,
vδE
ok
)
if
!
reflect
.
DeepEqual
(
δftail
.
vδE
,
vδE
)
{
t
.
Errorf
(
"vδE:
\n
have: %v
\n
want: %v"
,
δftail
.
vδE
,
vδE
)
}
...
...
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