Commit 177ba4e8 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent bc8389ed
...@@ -380,10 +380,11 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) { ...@@ -380,10 +380,11 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
δB.ByRoot[root] = δT δB.ByRoot[root] = δT
} }
} }
return δB, nil
// XXX .δBtail <- (δZ.rev, [](root, []key)) // XXX .δBtail <- (δZ.rev, [](root, []key))
// XXX rebuilf lastRevOf // XXX rebuilf lastRevOf
return δB, nil
} }
// δZConnectTracked computes connected closure of δZ/T. // δZConnectTracked computes connected closure of δZ/T.
...@@ -396,14 +397,10 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) { ...@@ -396,14 +397,10 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
// //
// δtopsByRoot = {} root -> {top changed nodes in that tree} // δtopsByRoot = {} root -> {top changed nodes in that tree}
func (δBtail *ΔBtail) δZConnectTracked(δZv *zodb.EventCommit) (δZTC SetOid, δtopsByRoot map[zodb.Oid]SetOid) { func (δBtail *ΔBtail) δZConnectTracked(δZv *zodb.EventCommit) (δZTC SetOid, δtopsByRoot map[zodb.Oid]SetOid) {
δZ := SetOid{} δZ := SetOid{}; for _, δ := range δZv.Changev { δZ.Add(δ) }
δZTC = SetOid{} δZTC = SetOid{}
δtopsByRoot = map[zodb.Oid]SetOid{} δtopsByRoot = map[zodb.Oid]SetOid{}
for _, δ := range δZv.Changev {
δZ.Add(δ)
}
for δ := range δZ { for δ := range δZ {
track, ok := δBtail.trackIdx[δ] track, ok := δBtail.trackIdx[δ]
if !ok { if !ok {
...@@ -541,7 +538,7 @@ func diffX(ctx context.Context, a, b Node, δZTC SetOid, trackIdx map[zodb.Oid]n ...@@ -541,7 +538,7 @@ func diffX(ctx context.Context, a, b Node, δZTC SetOid, trackIdx map[zodb.Oid]n
} }
} }
// diffT computes difference in between two revisions of a tree's subtree. // diffT computes difference in between two subtrees.
// //
// a, b point to top of the subtree @old and @new revisions. // a, b point to top of the subtree @old and @new revisions.
// δZTC is connected set of objects covering δZT (objects changed in this tree in old..new). // δZTC is connected set of objects covering δZT (objects changed in this tree in old..new).
...@@ -551,12 +548,6 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid] ...@@ -551,12 +548,6 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
fmt.Printf(" T %s %s\n", xidOf(a), xidOf(b)) fmt.Printf(" T %s %s\n", xidOf(a), xidOf(b))
defer xerr.Contextf(&err, "diffT %s %s", xidOf(a), xidOf(b)) defer xerr.Contextf(&err, "diffT %s %s", xidOf(a), xidOf(b))
/*
if (a != nil && b != nil) && (a.POid() != b.POid()) {
panic("different trees") // XXX wrong - tree object can be changed completely ?
}
*/
var av []TreeEntry var av []TreeEntry
var bv []TreeEntry var bv []TreeEntry
if a != nil { if a != nil {
...@@ -782,18 +773,12 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid] ...@@ -782,18 +773,12 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
return δ, nil return δ, nil
} }
// diffB computes difference in between two revisions of a bucket. // diffB computes difference in between two buckets.
// see diffX for details. // see diffX for details.
func diffB(ctx context.Context, a, b *Bucket) (δ map[Key]ΔValue, err error) { func diffB(ctx context.Context, a, b *Bucket) (δ map[Key]ΔValue, err error) {
fmt.Printf(" B %s %s\n", xidOf(a), xidOf(b)) fmt.Printf(" B %s %s\n", xidOf(a), xidOf(b))
defer xerr.Contextf(&err, "diffB %s %s", xidOf(a), xidOf(b)) defer xerr.Contextf(&err, "diffB %s %s", xidOf(a), xidOf(b))
// XXX oid can be InvalidOid for T/B... (i.e. B is part of T and is not yet committed separately) // XXX oid can be InvalidOid for T/B... (i.e. B is part of T and is not yet committed separately)
/*
if (a != nil && b != nil) && (a.POid() != b.POid()) {
panic("different buckets") // XXX wrong - bucket object can be changed completely ?
}
*/
var av []BucketEntry var av []BucketEntry
var bv []BucketEntry var bv []BucketEntry
......
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