Commit 55f9e24e authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent cf37f71d
...@@ -436,7 +436,7 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid) (δ map[Key]Value, err ...@@ -436,7 +436,7 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid) (δ map[Key]Value, err
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()) { if (a != nil && b != nil) && (a.POid() != b.POid()) {
panic("different trees") panic("different trees") // XXX wrong - tree object can be changed completely
} }
var av []TreeEntry var av []TreeEntry
...@@ -474,6 +474,7 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid) (δ map[Key]Value, err ...@@ -474,6 +474,7 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid) (δ map[Key]Value, err
for child := range allChildren { // XXX -> sorted? for child := range allChildren { // XXX -> sorted?
// add/del/modify, but child is not tracked - ignore // add/del/modify, but child is not tracked - ignore
// XXX correct only in children from a? (b could have changed childeren to new objects)
if !δZTC.Has(child) { if !δZTC.Has(child) {
continue continue
} }
...@@ -502,6 +503,15 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid) (δ map[Key]Value, err ...@@ -502,6 +503,15 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid) (δ map[Key]Value, err
} }
} }
// merge Tkdel <- δc
for k, v := range δc {
if v == VDEL {
Tkdel.Add(k)
} else {
delete(Tkdel, k)
}
}
// XXX process keys from δ outside of already tracked nodes // XXX process keys from δ outside of already tracked nodes
// XXX only deleted keys - no - delete can be from untracked // XXX only deleted keys - no - delete can be from untracked
// node and on tracked it is seen as addition // node and on tracked it is seen as addition
...@@ -517,7 +527,7 @@ func diffB(ctx context.Context, a, b *Bucket) (δ map[Key]Value, err error) { ...@@ -517,7 +527,7 @@ func diffB(ctx context.Context, a, b *Bucket) (δ map[Key]Value, err error) {
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()) { if (a != nil && b != nil) && (a.POid() != b.POid()) {
panic("different buckets") panic("different buckets") // XXX wrong - bucket object can be changed completely
} }
......
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