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
8ebcb0bb
Commit
8ebcb0bb
authored
Jun 17, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
ace9b05b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
11 deletions
+24
-11
wcfs/δbtail.go
wcfs/δbtail.go
+24
-11
No files found.
wcfs/δbtail.go
View file @
8ebcb0bb
...
@@ -238,15 +238,20 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
...
@@ -238,15 +238,20 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
δBtail
.
δZtail
.
Append
(
δZ
.
Tid
,
δZ
.
Changev
)
δBtail
.
δZtail
.
Append
(
δZ
.
Tid
,
δZ
.
Changev
)
// {} root ->
[]oid
changed under that root in tracked set
// {} root ->
{oid}
changed under that root in tracked set
δZByRoot
:=
map
[
zodb
.
Oid
]
[]
zodb
.
Oid
{}
// XXX -> map[*Tree]SetOid ?
δZByRoot
:=
map
[
zodb
.
Oid
]
SetOid
{}
for
_
,
oid
:=
range
δZ
.
Changev
{
for
_
,
oid
:=
range
δZ
.
Changev
{
roots
,
ok
:=
δBtail
.
trackIdx
[
oid
]
roots
,
ok
:=
δBtail
.
trackIdx
[
oid
]
if
!
ok
{
if
!
ok
{
continue
continue
}
}
for
root
:=
range
roots
{
for
root
:=
range
roots
{
δZByRoot
[
root
]
=
append
(
δZByRoot
[
root
],
oid
)
δZT
,
ok
:=
δZByRoot
[
root
]
if
!
ok
{
δZT
=
SetOid
{}
δZByRoot
[
root
]
=
δZT
}
δZT
.
Add
(
oid
)
}
}
}
}
...
@@ -270,17 +275,15 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
...
@@ -270,17 +275,15 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
return
ΔB
{},
err
return
ΔB
{},
err
}
}
_
=
zconnOld
for
root
,
δZT
:=
range
δZByRoot
{
_
=
zconnNew
δT
,
err
:=
δBtail
.
treediff
(
ctx
,
root
,
δZT
,
zconnOld
,
zconnNew
)
if
err
!=
nil
{
return
ΔB
{},
err
}
for
root
:=
range
δZByRoot
{
if
len
(
δT
)
>
0
{
// an object might be resaved without change
δT
,
ok
:=
δB
.
ByRoot
[
root
]
if
!
ok
{
δT
=
map
[
Key
]
Value
{}
δB
.
ByRoot
[
root
]
=
δT
δB
.
ByRoot
[
root
]
=
δT
}
}
// XXX stub to get file.size invalidation working
// TODO update δT
}
}
return
δB
,
nil
return
δB
,
nil
...
@@ -304,6 +307,16 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
...
@@ -304,6 +307,16 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
*/
*/
}
}
// treediff computes δT for tree specified by root in between old..new.
//
// XXX only for tracked
// δZT is δZ/T - subset of δZ touching nodes of T.
func
(
δBtail
*
ΔBtail
)
treediff
(
ctx
context
.
Context
,
root
zodb
.
Oid
,
δZT
SetOid
,
zconnOld
,
zconnNew
*
zodb
.
Connection
)
(
δT
map
[
Key
]
Value
,
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"treediff %s"
,
root
)
return
nil
,
nil
// XXX stub
}
func
(
δBtail
*
ΔBtail
)
ForgetPast
(
revCut
zodb
.
Tid
)
{
func
(
δBtail
*
ΔBtail
)
ForgetPast
(
revCut
zodb
.
Tid
)
{
...
...
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