Commit 9d3483ba authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 1ebb0d4a
...@@ -465,6 +465,7 @@ func treediff(ctx context.Context, root zodb.Oid, δZT SetOid, trackIdx map[zodb ...@@ -465,6 +465,7 @@ func treediff(ctx context.Context, root zodb.Oid, δZT SetOid, trackIdx map[zodb
// XXX no - not needed here - keys cannot migrate in between two disconnected subtrees // XXX no - not needed here - keys cannot migrate in between two disconnected subtrees
// DEL k -> Tkextra += k // DEL k -> Tkextra += k
// +k -> Tkextra -= k // +k -> Tkextra -= k
fmt.Printf("-> δtop: %v\n", δtop)
for k,δv := range δtop { for k,δv := range δtop {
δT[k] = δv δT[k] = δv
} }
...@@ -647,6 +648,7 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid] ...@@ -647,6 +648,7 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
δv.New = δv1.New δv.New = δv1.New
} }
fmt.Printf(" [%v] merge %s %s -> %s\n", k, δv1, δv2, δv)
if δv.Old != δv.New { if δv.Old != δv.New {
δ[k] = δv δ[k] = δv
} else { } else {
......
...@@ -1141,3 +1141,15 @@ func sortedKeys(kv map[Key]Δstring) []Key { ...@@ -1141,3 +1141,15 @@ func sortedKeys(kv map[Key]Δstring) []Key {
}) })
return keyv return keyv
} }
// String is like default %v, but uses ø for VDEL.
func (δv ΔValue) String() string {
old, new := DEL, DEL
if δv.Old != VDEL {
old = δv.Old.String()
}
if δv.New != VDEL {
new = δv.New.String()
}
return fmt.Sprintf("{%s %s}", old, new)
}
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