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
177ba4e8
Commit
177ba4e8
authored
Jun 22, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
bc8389ed
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
20 deletions
+5
-20
wcfs/δbtail.go
wcfs/δbtail.go
+5
-20
No files found.
wcfs/δbtail.go
View file @
177ba4e8
...
@@ -380,10 +380,11 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
...
@@ -380,10 +380,11 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
δB
.
ByRoot
[
root
]
=
δT
δB
.
ByRoot
[
root
]
=
δT
}
}
}
}
return
δB
,
nil
// XXX .δBtail <- (δZ.rev, [](root, []key))
// XXX .δBtail <- (δZ.rev, [](root, []key))
// XXX rebuilf lastRevOf
// XXX rebuilf lastRevOf
return
δB
,
nil
}
}
// δZConnectTracked computes connected closure of δZ/T.
// δZConnectTracked computes connected closure of δZ/T.
...
@@ -396,14 +397,10 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
...
@@ -396,14 +397,10 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
//
//
// δtopsByRoot = {} root -> {top changed nodes in that tree}
// δtopsByRoot = {} root -> {top changed nodes in that tree}
func
(
δBtail
*
ΔBtail
)
δZConnectTracked
(
δZv
*
zodb
.
EventCommit
)
(
δZTC
SetOid
,
δtopsByRoot
map
[
zodb
.
Oid
]
SetOid
)
{
func
(
δBtail
*
ΔBtail
)
δZConnectTracked
(
δZv
*
zodb
.
EventCommit
)
(
δZTC
SetOid
,
δtopsByRoot
map
[
zodb
.
Oid
]
SetOid
)
{
δZ
:=
SetOid
{}
δZ
:=
SetOid
{}
;
for
_
,
δ
:=
range
δZv
.
Changev
{
δZ
.
Add
(
δ
)
}
δZTC
=
SetOid
{}
δZTC
=
SetOid
{}
δtopsByRoot
=
map
[
zodb
.
Oid
]
SetOid
{}
δtopsByRoot
=
map
[
zodb
.
Oid
]
SetOid
{}
for
_
,
δ
:=
range
δZv
.
Changev
{
δZ
.
Add
(
δ
)
}
for
δ
:=
range
δZ
{
for
δ
:=
range
δZ
{
track
,
ok
:=
δBtail
.
trackIdx
[
δ
]
track
,
ok
:=
δBtail
.
trackIdx
[
δ
]
if
!
ok
{
if
!
ok
{
...
@@ -541,7 +538,7 @@ func diffX(ctx context.Context, a, b Node, δZTC SetOid, trackIdx map[zodb.Oid]n
...
@@ -541,7 +538,7 @@ func diffX(ctx context.Context, a, b Node, δZTC SetOid, trackIdx map[zodb.Oid]n
}
}
}
}
// diffT computes difference in between two
revisions of a tree's subtree
.
// diffT computes difference in between two
subtrees
.
//
//
// a, b point to top of the subtree @old and @new revisions.
// a, b point to top of the subtree @old and @new revisions.
// δZTC is connected set of objects covering δZT (objects changed in this tree in old..new).
// δZTC is connected set of objects covering δZT (objects changed in this tree in old..new).
...
@@ -551,12 +548,6 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
...
@@ -551,12 +548,6 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
fmt
.
Printf
(
" T %s %s
\n
"
,
xidOf
(
a
),
xidOf
(
b
))
fmt
.
Printf
(
" T %s %s
\n
"
,
xidOf
(
a
),
xidOf
(
b
))
defer
xerr
.
Contextf
(
&
err
,
"diffT %s %s"
,
xidOf
(
a
),
xidOf
(
b
))
defer
xerr
.
Contextf
(
&
err
,
"diffT %s %s"
,
xidOf
(
a
),
xidOf
(
b
))
/*
if (a != nil && b != nil) && (a.POid() != b.POid()) {
panic("different trees") // XXX wrong - tree object can be changed completely ?
}
*/
var
av
[]
TreeEntry
var
av
[]
TreeEntry
var
bv
[]
TreeEntry
var
bv
[]
TreeEntry
if
a
!=
nil
{
if
a
!=
nil
{
...
@@ -782,18 +773,12 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
...
@@ -782,18 +773,12 @@ func diffT(ctx context.Context, a, b *Tree, δZTC SetOid, trackIdx map[zodb.Oid]
return
δ
,
nil
return
δ
,
nil
}
}
// diffB computes difference in between two
revisions of a bucket
.
// diffB computes difference in between two
buckets
.
// see diffX for details.
// see diffX for details.
func
diffB
(
ctx
context
.
Context
,
a
,
b
*
Bucket
)
(
δ
map
[
Key
]
ΔValue
,
err
error
)
{
func
diffB
(
ctx
context
.
Context
,
a
,
b
*
Bucket
)
(
δ
map
[
Key
]
ΔValue
,
err
error
)
{
fmt
.
Printf
(
" B %s %s
\n
"
,
xidOf
(
a
),
xidOf
(
b
))
fmt
.
Printf
(
" B %s %s
\n
"
,
xidOf
(
a
),
xidOf
(
b
))
defer
xerr
.
Contextf
(
&
err
,
"diffB %s %s"
,
xidOf
(
a
),
xidOf
(
b
))
defer
xerr
.
Contextf
(
&
err
,
"diffB %s %s"
,
xidOf
(
a
),
xidOf
(
b
))
// XXX oid can be InvalidOid for T/B... (i.e. B is part of T and is not yet committed separately)
// XXX oid can be InvalidOid for T/B... (i.e. B is part of T and is not yet committed separately)
/*
if (a != nil && b != nil) && (a.POid() != b.POid()) {
panic("different buckets") // XXX wrong - bucket object can be changed completely ?
}
*/
var
av
[]
BucketEntry
var
av
[]
BucketEntry
var
bv
[]
BucketEntry
var
bv
[]
BucketEntry
...
...
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