Commit 46c44e54 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent ee2bb183
...@@ -222,6 +222,7 @@ func verifyΔBTail1(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, at1,at2 zodb.T ...@@ -222,6 +222,7 @@ func verifyΔBTail1(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, at1,at2 zodb.T
txn, ctx := transaction.New(context.Background()) txn, ctx := transaction.New(context.Background())
defer txn.Abort() defer txn.Abort()
// zconn, δbtail @at1 with initial tracked set
zconn, err := db.Open(ctx, &zodb.ConnOptions{At: at1}); X(err) zconn, err := db.Open(ctx, &zodb.ConnOptions{At: at1}); X(err)
δbtail := NewΔBtail(zconn.At()) δbtail := NewΔBtail(zconn.At())
...@@ -229,11 +230,15 @@ func verifyΔBTail1(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, at1,at2 zodb.T ...@@ -229,11 +230,15 @@ func verifyΔBTail1(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, at1,at2 zodb.T
ztree := xtree.(*Tree) ztree := xtree.(*Tree)
for _, k := range initialTrackedKeys { for _, k := range initialTrackedKeys {
treePath := []Node{} path := []Node{}
_, _, err = ztree.VGet(ctx, k, func(node Node) { _, _, err = ztree.VGet(ctx, k, func(node Node) {
treePath = append(treePath, node) path = append(path, node)
}); X(err) }); X(err)
δbtail.Track(path)
} }
// XXX
} }
func TestΔBTail(t *testing.T) { func TestΔBTail(t *testing.T) {
...@@ -267,6 +272,7 @@ func TestΔBTail(t *testing.T) { ...@@ -267,6 +272,7 @@ func TestΔBTail(t *testing.T) {
err := db.Close(); X(err) err := db.Close(); X(err)
}() }()
/*
XXX := func(tree1, tree2 string) { XXX := func(tree1, tree2 string) {
// XXX commit tree1 // XXX commit tree1
// XXX load tree1 -> get keys for kv1 // XXX load tree1 -> get keys for kv1
...@@ -293,6 +299,7 @@ func TestΔBTail(t *testing.T) { ...@@ -293,6 +299,7 @@ func TestΔBTail(t *testing.T) {
kv2 := XGetTree(db, tg.head, tg.treeRoot) kv2 := XGetTree(db, tg.head, tg.treeRoot)
fmt.Println(kv2) fmt.Println(kv2)
} }
*/
// direct tree_i -> tree_{i+1} // direct tree_i -> tree_{i+1}
at1 := tg.head at1 := tg.head
......
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