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
17d96e82
Commit
17d96e82
authored
Jun 17, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
4a7e9275
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
4 deletions
+23
-4
wcfs/δbtail.go
wcfs/δbtail.go
+23
-4
No files found.
wcfs/δbtail.go
View file @
17d96e82
...
...
@@ -319,7 +319,8 @@ func (δBtail *ΔBtail) treediff(ctx context.Context, root zodb.Oid, δZT SetOid
defer
xerr
.
Contextf
(
&
err
,
"treediff %s..%s %s"
,
zconnOld
.
At
(),
zconnNew
.
At
(),
root
)
// XXX zconnX -> a, b ?
// XXX stub
δT
=
map
[
Key
]
Value
{}
for
oid
:=
range
δZT
{
xa
,
err1
:=
zconnOld
.
Get
(
ctx
,
oid
)
xb
,
err2
:=
zconnNew
.
Get
(
ctx
,
oid
)
...
...
@@ -342,8 +343,15 @@ func (δBtail *ΔBtail) treediff(ctx context.Context, root zodb.Oid, δZT SetOid
case
*
Bucket
:
b
:=
xb
.
(
*
Bucket
)
// must not fail
diffB
(
a
,
b
)
δb
,
err
:=
diffB
(
ctx
,
a
,
b
)
if
err
!=
nil
{
return
nil
,
err
}
for
k
,
v
:=
range
δb
{
δT
[
k
]
=
v
}
// XXX stub
case
*
Tree
:
b
:=
xb
.
(
*
Tree
)
// must not fail
// TODO handle
...
...
@@ -351,17 +359,28 @@ func (δBtail *ΔBtail) treediff(ctx context.Context, root zodb.Oid, δZT SetOid
}
}
return
nil
,
nil
// XXX stub
return
δT
,
nil
}
// diffB computes difference in between two revisions of a bucket.
// the buckets must be already activated
func
diffB
(
a
,
b
*
Bucket
)
(
δ
map
[
Key
]
Value
,
err
error
)
{
func
diffB
(
ctx
context
.
Context
,
a
,
b
*
Bucket
)
(
δ
map
[
Key
]
Value
,
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"diffB %s"
,
a
.
POid
())
if
a
.
POid
()
!=
b
.
POid
()
{
panic
(
"different buckets"
)
}
err
=
a
.
PActivate
(
ctx
)
if
err
!=
nil
{
return
nil
,
err
}
defer
a
.
PDeactivate
()
err
=
b
.
PActivate
(
ctx
)
if
err
!=
nil
{
return
nil
,
err
}
defer
b
.
PDeactivate
()
av
:=
a
.
Entryv
()
// key↑
bv
:=
b
.
Entryv
()
// key↑
δ
=
map
[
Key
]
Value
{}
...
...
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