Commit ece1c216 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 8b595000
......@@ -877,7 +877,6 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
Aqueue = SetKey{}
for k := range Bqueue {
fmt.Printf(" B [%v]\n", k)
Bdone.Add(k)
bnode, ok, err := bv.GetToLeaf(ctx, k)
if err != nil {
return nil, err
......@@ -889,8 +888,7 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
// XXX check for bnode.node.(*Tree) (ø tree case)
// + bucket if not already done
// XXX update track.hole if k not in bbucket
// +bucket if that bucket is reached for the first time
if !bnode.done {
δB, err := diffB(ctx, nil, bnode.node.(*Bucket))
if err != nil {
......@@ -903,16 +901,25 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
return nil, err
}
// Bdone <- δB
// Aqueue <- δB
for k := range δB {
if !Adone.Has(k) {
Aqueue.Add(k)
for k_ := range δB {
Bdone.Add(k_)
if !Adone.Has(k_) {
Aqueue.Add(k_)
}
}
bnode.done = true
}
// add k as hole if k is not there
if !Bdone.Has(k) {
δB := map[Key]ΔValue{k: {VDEL, VDEL}} // hole
err = δMerge(δ, δB); if err != nil { return nil, err }
Bdone.Add(k)
}
fmt.Printf(" bv: %s\n", bv)
}
......@@ -1000,7 +1007,7 @@ func δMerge(δ, δ2 map[Key]ΔValue) error {
if δv.Old != δv.New {
δ[k] = δv
} else {
delete(δ, k)
delete(δ, k) // NOTE also annihilates hole migration
}
}
......
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