Commit d24d23a7 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent f81aa6f8
...@@ -689,9 +689,10 @@ func (δBtail *ΔBtail) rebuild() (err error) { ...@@ -689,9 +689,10 @@ func (δBtail *ΔBtail) rebuild() (err error) {
δTtail, ok := δBtail.byRoot[root] δTtail, ok := δBtail.byRoot[root]
if !ok { if !ok {
// this root was not tracked before -> create δTtail for it with empty changes // this root was not tracked before -> create δTtail for it with empty changes
// XXX do not keep entries with empty δkv ?
var vδT []ΔTree var vδT []ΔTree
for j := 0; j < len(vδZ); j++ { for _, δZj := range vδZ {
vδT = append(vδT, ΔTree{Rev: vδZ[j].Rev, ΔKV: make(map[Key]ΔValue)}) vδT = append(vδT, ΔTree{Rev: δZj.Rev, ΔKV: make(map[Key]ΔValue)})
} }
δTtail = &ΔTtail{ δTtail = &ΔTtail{
vδT: vδT, vδT: vδT,
...@@ -745,8 +746,6 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) { ...@@ -745,8 +746,6 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
// update .trackIdx and vδB from .trackNew // update .trackIdx and vδB from .trackNew
δBtail.rebuild() δBtail.rebuild()
δBtail.δZtail.Append(δZ.Tid, δZ.Changev)
tracef("Update δZ: %v\n", δZ.Changev) tracef("Update δZ: %v\n", δZ.Changev)
tracef("trackIdx: %v\n", δBtail.trackIdx) tracef("trackIdx: %v\n", δBtail.trackIdx)
tracef("holeIdxByRoot: %v\n", δBtail.holeIdxByRoot) tracef("holeIdxByRoot: %v\n", δBtail.holeIdxByRoot)
...@@ -787,7 +786,12 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) { ...@@ -787,7 +786,12 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
δB.ByRoot[root] = δT δB.ByRoot[root] = δT
δTtail, ok := δBtail.byRoot[root] δTtail, ok := δBtail.byRoot[root]
if !ok { if !ok {
// this root was not tracked before ... XXX // this root was not tracked before -> create δTtail for it with empty changes
// XXX do not keep entries with empty δkv ?
var vδT []ΔTree
for _, δZj := range δBtail.δZtail.Data() {
vδT = append(vδT, ΔTree{Rev: δZj.Rev, ΔKV: make(map[Key]ΔValue)})
}
δTtail = &ΔTtail { δTtail = &ΔTtail {
// XXX vδT: ... // XXX vδT: ...
// XXX KVAtTail: ..., // XXX KVAtTail: ...,
...@@ -803,6 +807,7 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) { ...@@ -803,6 +807,7 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
} }
} }
δBtail.δZtail.Append(δZ.Tid, δZ.Changev)
return δB, nil return δB, nil
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment