Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
e40c32c9
Commit
e40c32c9
authored
May 31, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
e5e93e30
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
+17
-14
wcfs/δbtail_test.go
wcfs/δbtail_test.go
+17
-14
No files found.
wcfs/δbtail_test.go
View file @
e40c32c9
...
...
@@ -148,21 +148,12 @@ func (tg *TreeGen) Commit(tree string) (_ zodb.Tid, err error) {
// XGetTree loads LOBtree from zurl@at->obj<root>.
// Tree values must be ZBlk whose data is returned instead of references to ZBlk.
func
XGetTree
(
zurl
string
,
at
zodb
.
Tid
,
root
zodb
.
Oid
)
map
[
int64
]
string
{
//defer xerr.Contextf(&err, "%s: @%s: get tree %s", zurl, at, root)
defer
exc
.
Contextf
(
"%s: @%s: get tree %s"
,
zurl
,
at
,
root
)
func
XGetTree
(
db
*
zodb
.
DB
,
at
zodb
.
Tid
,
root
zodb
.
Oid
)
map
[
int64
]
string
{
defer
exc
.
Contextf
(
"%s: @%s: get tree %s"
,
db
.
Storage
()
.
URL
(),
at
,
root
)
X
:=
exc
.
Raiseif
ctx
:=
context
.
Background
()
// XXX pass IStorage to here instead of zurl?
zstor
,
err
:=
zodb
.
Open
(
ctx
,
zurl
,
&
zodb
.
OpenOptions
{
ReadOnly
:
true
});
X
(
err
)
defer
zstor
.
Close
()
// XXX err
db
:=
zodb
.
NewDB
(
zstor
)
defer
db
.
Close
()
// XXX err
txn
,
ctx
:=
transaction
.
New
(
ctx
)
txn
,
ctx
:=
transaction
.
New
(
context
.
Background
())
defer
txn
.
Abort
()
zconn
,
err
:=
db
.
Open
(
ctx
,
&
zodb
.
ConnOptions
{
At
:
at
});
X
(
err
)
...
...
@@ -218,6 +209,18 @@ func TestΔBTail(t *testing.T) {
err
:=
tg
.
Close
();
X
(
err
)
}()
zstor
,
err
:=
zodb
.
Open
(
context
.
Background
(),
tg
.
zurl
,
&
zodb
.
OpenOptions
{
ReadOnly
:
true
,
});
X
(
err
)
defer
func
()
{
err
:=
zstor
.
Close
();
X
(
err
)
}()
db
:=
zodb
.
NewDB
(
zstor
)
defer
func
()
{
err
:=
db
.
Close
();
X
(
err
)
}()
XXX
:=
func
(
tree1
,
tree2
string
)
{
// XXX commit tree1
// XXX load tree1 -> get keys for kv1
...
...
@@ -238,10 +241,10 @@ func TestΔBTail(t *testing.T) {
// verify δB has all keys as expected for tracked set
_
,
err
:=
tg
.
Commit
(
tree1
);
X
(
err
)
kv1
:=
XGetTree
(
tg
.
zurl
,
tg
.
head
,
tg
.
treeRoot
)
kv1
:=
XGetTree
(
db
,
tg
.
head
,
tg
.
treeRoot
)
fmt
.
Println
(
kv1
)
_
,
err
=
tg
.
Commit
(
tree2
);
X
(
err
)
kv2
:=
XGetTree
(
tg
.
zurl
,
tg
.
head
,
tg
.
treeRoot
)
kv2
:=
XGetTree
(
db
,
tg
.
head
,
tg
.
treeRoot
)
fmt
.
Println
(
kv2
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment