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
1679ddf1
Commit
1679ddf1
authored
Sep 13, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
0e46b293
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
9 deletions
+34
-9
wcfs/internal/zdata/δftail.go
wcfs/internal/zdata/δftail.go
+24
-9
wcfs/internal/zdata/δftail_test.go
wcfs/internal/zdata/δftail_test.go
+10
-0
No files found.
wcfs/internal/zdata/δftail.go
View file @
1679ddf1
...
...
@@ -379,13 +379,13 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) (_ ΔF, err error) {
}
// take btree changes into account
//
fmt.Printf("δB.ΔByRoot: %v\n", δB.ΔByRoot)
//
fmt.Printf("δB.ΔByRoot: %v\n", δB.ΔByRoot)
for
root
,
δt
:=
range
δB
.
ΔByRoot
{
//
fmt.Printf("root: %v δt: %v\n", root, δt)
//
fmt.Printf("root: %v δt: %v\n", root, δt)
files
:=
δFtail
.
fileIdx
[
root
]
if
len
(
files
)
==
0
{
panicf
(
"BUG: ΔFtail: root<%s> -> ø files"
,
root
)
}
// NOTE files might be empty e.g. if a zfile was tracked, then
// deleted, but the tree referenced by zfile.blktab is still
// not-deleted, remains tracked and is changed.
for
file
:=
range
files
{
δfile
,
ok
:=
δF
.
ByFile
[
file
]
if
!
ok
{
...
...
@@ -393,7 +393,6 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) (_ ΔF, err error) {
δF
.
ByFile
[
file
]
=
δfile
}
for
blk
/*, δzblk*/
:=
range
δt
{
// XXX document, and in particular how to include atTail
δfile
.
Blocks
.
Add
(
blk
)
}
...
...
@@ -446,7 +445,7 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) (_ ΔF, err error) {
if
len
(
inblk
)
==
0
{
continue
}
//
fmt.Printf("root: %v inblk: %v\n", root, inblk)
//
fmt.Printf("root: %v inblk: %v\n", root, inblk)
files
:=
δFtail
.
fileIdx
[
root
]
for
file
:=
range
files
{
δfile
,
ok
:=
δF
.
ByFile
[
file
]
...
...
@@ -473,10 +472,26 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) (_ ΔF, err error) {
// XXX + rebuild XXX not here - in track(new file)
_
=
δ
//fmt.Printf("δZBigFile: %v\n", δ)
// XXX update .fileIdx
// update .fileIdx
if
δ
.
blktabOld
!=
xbtree
.
VDEL
{
files
,
ok
:=
δFtail
.
fileIdx
[
δ
.
blktabOld
]
if
ok
{
files
.
Del
(
foid
)
if
len
(
files
)
==
0
{
delete
(
δFtail
.
fileIdx
,
δ
.
blktabOld
)
}
}
}
if
δ
.
blktabNew
!=
xbtree
.
VDEL
{
files
,
ok
:=
δFtail
.
fileIdx
[
δ
.
blktabNew
]
if
!
ok
{
files
=
setOid
{}
δFtail
.
fileIdx
[
δ
.
blktabNew
]
=
files
}
files
.
Add
(
foid
)
}
}
// fmt.Printf("-> δF: %v\n", δF)
...
...
wcfs/internal/zdata/δftail_test.go
View file @
1679ddf1
...
...
@@ -485,6 +485,16 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
vδE
=
vδE
[
icut
:
]
}
// verify δFtail.fileIdx
fileIdxOK
:=
map
[
zodb
.
Oid
]
setOid
{}
if
!
delfile
{
__
:=
setOid
{};
__
.
Add
(
foid
)
fileIdxOK
[
t
.
Root
()]
=
__
}
if
!
reflect
.
DeepEqual
(
δFtail
.
fileIdx
,
fileIdxOK
)
{
t
.
Errorf
(
"fileIdx:
\n
have: %v
\n
want: %v"
,
δFtail
.
fileIdx
,
fileIdxOK
)
}
// verify δftail.root
δftail
:=
δFtail
.
byFile
[
foid
]
rootOK
:=
t
.
Root
()
...
...
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