Commit 2812f85e authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent d24d23a7
...@@ -746,13 +746,15 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) { ...@@ -746,13 +746,15 @@ 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()
tracef("Update δZ: %v\n", δZ.Changev) tracef("Update @%s -> @%s\n", δBtail.Head(), δZ.Tid)
tracef("δZ:\t%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)
// XXX dup wrt rebuild? // XXX dup wrt rebuild?
δBtail.δZtail.Append(δZ.Tid, δZ.Changev)
δZTC, δtopsByRoot := δZConnectTracked(δZ.Changev, δBtail.trackIdx) δZTC, δtopsByRoot := δZConnectTracked(δZ.Changev, δBtail.trackIdx)
δB := ΔB{Rev: δZ.Tid, ByRoot: make(map[zodb.Oid]map[Key]ΔValue)} δB := ΔB{Rev: δZ.Tid, ByRoot: make(map[zodb.Oid]map[Key]ΔValue)}
...@@ -789,7 +791,8 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) { ...@@ -789,7 +791,8 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
// 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 ? // XXX do not keep entries with empty δkv ?
var vδT []ΔTree var vδT []ΔTree
for _, δZj := range δBtail.δZtail.Data() { vδZ := δBtail.δZtail.Data()
for _, δZj := range vδZ[:len(vδZ)-1] {
vδT = append(vδT, ΔTree{Rev: δZj.Rev, ΔKV: make(map[Key]ΔValue)}) vδT = append(vδT, ΔTree{Rev: δZj.Rev, ΔKV: make(map[Key]ΔValue)})
} }
δTtail = &ΔTtail { δTtail = &ΔTtail {
...@@ -807,7 +810,6 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) { ...@@ -807,7 +810,6 @@ 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