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
6672e880
Commit
6672e880
authored
Jul 16, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
f41b7f88
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
15 deletions
+14
-15
wcfs/internal/xbtree/xbtreetest/treeenv.go
wcfs/internal/xbtree/xbtreetest/treeenv.go
+10
-0
wcfs/internal/xbtree/δbtail_test.go
wcfs/internal/xbtree/δbtail_test.go
+4
-15
No files found.
wcfs/internal/xbtree/xbtreetest/treeenv.go
View file @
6672e880
...
@@ -266,6 +266,16 @@ func (t *Commit) XGetBlkData(oid zodb.Oid) string {
...
@@ -266,6 +266,16 @@ func (t *Commit) XGetBlkData(oid zodb.Oid) string {
return
zblki
.
Data
return
zblki
.
Data
}
}
// XGetBlkByName returns ZBlk info associated with ZBlk<name>
func
(
t
*
Commit
)
XGetBlkByName
(
name
string
)
(
zodb
.
Oid
,
ZBlkInfo
)
{
for
oid
,
zblki
:=
range
t
.
ZBlkTab
{
if
zblki
.
Name
==
name
{
return
oid
,
zblki
}
}
panicf
(
"ZBlk<%q> not found"
,
name
)
return
zodb
.
InvalidOid
,
ZBlkInfo
{}
// XXX should be not needed
}
// xGetTree loads Tree from zurl@at->obj<root>.
// xGetTree loads Tree from zurl@at->obj<root>.
//
//
...
...
wcfs/internal/xbtree/δbtail_test.go
View file @
6672e880
...
@@ -1260,17 +1260,6 @@ func TestΔBtailSliceByRootRev(t_ *testing.T) {
...
@@ -1260,17 +1260,6 @@ func TestΔBtailSliceByRootRev(t_ *testing.T) {
t
.
Errorf
(
"%s:
\n
have: %s
\n
want: %s"
,
subj
,
have
,
want
)
t
.
Errorf
(
"%s:
\n
have: %s
\n
want: %s"
,
subj
,
have
,
want
)
}
}
// zblkByName returns oid of ZBlk that has .Name == name
zblkByName
:=
func
(
name
string
)
zodb
.
Oid
{
for
oid
,
zblki
:=
range
t0
.
ZBlkTab
{
if
zblki
.
Name
==
name
{
return
oid
}
}
panicf
(
"ZBlk<%q> not found"
,
name
)
return
zodb
.
InvalidOid
// XXX should be not needed
}
s00
:=
δbtail
.
SliceByRootRev
(
t
.
Root
(),
t0
.
At
,
t0
.
At
)
s00
:=
δbtail
.
SliceByRootRev
(
t
.
Root
(),
t0
.
At
,
t0
.
At
)
s01
:=
δbtail
.
SliceByRootRev
(
t
.
Root
(),
t0
.
At
,
t1
.
At
)
s01
:=
δbtail
.
SliceByRootRev
(
t
.
Root
(),
t0
.
At
,
t1
.
At
)
s02
:=
δbtail
.
SliceByRootRev
(
t
.
Root
(),
t0
.
At
,
t2
.
At
)
s02
:=
δbtail
.
SliceByRootRev
(
t
.
Root
(),
t0
.
At
,
t2
.
At
)
...
@@ -1286,8 +1275,8 @@ func TestΔBtailSliceByRootRev(t_ *testing.T) {
...
@@ -1286,8 +1275,8 @@ func TestΔBtailSliceByRootRev(t_ *testing.T) {
assertvδT
(
"t2.s22"
,
s22
)
assertvδT
(
"t2.s22"
,
s22
)
// sXX should be all aliased to vδT
// sXX should be all aliased to vδT
gg
:=
zb
lkByName
(
"g"
)
gg
,
_
:=
t0
.
XGetB
lkByName
(
"g"
)
hh
:=
zb
lkByName
(
"h"
)
hh
,
_
:=
t0
.
XGetB
lkByName
(
"h"
)
vδT
[
0
]
.
Rev
=
t0
.
At
;
δkv0
:=
vδT
[
0
]
.
ΔKV
;
vδT
[
0
]
.
ΔKV
=
map
[
Key
]
ΔValue
{
11
:
{
gg
,
gg
}}
vδT
[
0
]
.
Rev
=
t0
.
At
;
δkv0
:=
vδT
[
0
]
.
ΔKV
;
vδT
[
0
]
.
ΔKV
=
map
[
Key
]
ΔValue
{
11
:
{
gg
,
gg
}}
vδT
[
1
]
.
Rev
=
t0
.
At
;
δkv1
:=
vδT
[
1
]
.
ΔKV
;
vδT
[
1
]
.
ΔKV
=
map
[
Key
]
ΔValue
{
12
:
{
hh
,
hh
}}
vδT
[
1
]
.
Rev
=
t0
.
At
;
δkv1
:=
vδT
[
1
]
.
ΔKV
;
vδT
[
1
]
.
ΔKV
=
map
[
Key
]
ΔValue
{
12
:
{
hh
,
hh
}}
assertvδT
(
"t2.vδT*"
,
vδT
,
ΔT
{
t0
.
At
,
δ
{
11
:
{
g
,
g
}}},
ΔT
{
t0
.
At
,
δ
{
12
:
{
h
,
h
}}})
assertvδT
(
"t2.vδT*"
,
vδT
,
ΔT
{
t0
.
At
,
δ
{
11
:
{
g
,
g
}}},
ΔT
{
t0
.
At
,
δ
{
12
:
{
h
,
h
}}})
...
@@ -1331,8 +1320,8 @@ func TestΔBtailSliceByRootRev(t_ *testing.T) {
...
@@ -1331,8 +1320,8 @@ func TestΔBtailSliceByRootRev(t_ *testing.T) {
assertvδT
(
"t12.s22_"
,
s22_
)
assertvδT
(
"t12.s22_"
,
s22_
)
// sXX_ should be all aliased to vδT, but not sXX
// sXX_ should be all aliased to vδT, but not sXX
bb
:=
zb
lkByName
(
"b"
)
bb
,
_
:=
t0
.
XGetB
lkByName
(
"b"
)
cc
:=
zb
lkByName
(
"c"
)
cc
,
_
:=
t0
.
XGetB
lkByName
(
"c"
)
vδT
[
0
]
.
Rev
=
t0
.
At
;
δkv0
=
vδT
[
0
]
.
ΔKV
;
vδT
[
0
]
.
ΔKV
=
map
[
Key
]
ΔValue
{
111
:
{
bb
,
bb
}}
vδT
[
0
]
.
Rev
=
t0
.
At
;
δkv0
=
vδT
[
0
]
.
ΔKV
;
vδT
[
0
]
.
ΔKV
=
map
[
Key
]
ΔValue
{
111
:
{
bb
,
bb
}}
vδT
[
1
]
.
Rev
=
t0
.
At
;
δkv1
=
vδT
[
1
]
.
ΔKV
;
vδT
[
1
]
.
ΔKV
=
map
[
Key
]
ΔValue
{
112
:
{
cc
,
cc
}}
vδT
[
1
]
.
Rev
=
t0
.
At
;
δkv1
=
vδT
[
1
]
.
ΔKV
;
vδT
[
1
]
.
ΔKV
=
map
[
Key
]
ΔValue
{
112
:
{
cc
,
cc
}}
assertvδT
(
"t12.vδT*"
,
vδT
,
ΔT
{
t0
.
At
,
δ
{
111
:
{
b
,
b
}}},
ΔT
{
t0
.
At
,
δ
{
112
:
{
c
,
c
}}})
assertvδT
(
"t12.vδT*"
,
vδT
,
ΔT
{
t0
.
At
,
δ
{
111
:
{
b
,
b
}}},
ΔT
{
t0
.
At
,
δ
{
112
:
{
c
,
c
}}})
...
...
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