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
8316aa92
Commit
8316aa92
authored
Oct 13, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
55fdc2c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
36 deletions
+50
-36
wcfs/internal/zdata/δftail.go
wcfs/internal/zdata/δftail.go
+50
-36
No files found.
wcfs/internal/zdata/δftail.go
View file @
8316aa92
...
...
@@ -339,41 +339,9 @@ func (δftail *_ΔFileTail) _rebuild1(foid zodb.Oid, δZtail *zodb.ΔTail, db *z
panic
(
"rebuild1: vδE != nil"
)
}
vδE
:=
[]
_ΔFileEpoch
{}
vδZ
:=
δZtail
.
Data
()
atPrev
:=
δZtail
.
Tail
()
for
i
:=
0
;
i
<
len
(
vδZ
);
i
++
{
δZ
:=
vδZ
[
i
]
fchanged
:=
false
for
_
,
oid
:=
range
δZ
.
Changev
{
if
oid
==
foid
{
fchanged
=
true
break
}
}
if
!
fchanged
{
continue
}
δ
,
err
:=
zfilediff
(
db
,
foid
,
atPrev
,
δZ
.
Rev
)
if
err
!=
nil
{
return
err
}
if
δ
!=
nil
{
δE
:=
_ΔFileEpoch
{
Rev
:
δZ
.
Rev
,
oldRoot
:
δ
.
blktabOld
,
newRoot
:
δ
.
blktabNew
,
oldBlkSize
:
δ
.
blksizeOld
,
newBlkSize
:
δ
.
blksizeNew
,
oldTrackSetZBlk
:
nil
,
// nothing was tracked
}
vδE
=
append
(
vδE
,
δE
)
}
atPrev
=
δZ
.
Rev
vδE
,
err
:=
vδEBuild
(
foid
,
δZtail
,
db
)
if
err
!=
nil
{
return
err
}
δftail
.
vδE
=
vδE
...
...
@@ -971,7 +939,53 @@ func (δFtail *ΔFtail) _BlkRevAt(ctx context.Context, zfile *ZBigFile, blk int6
}
// ----------------------------------------
// ---- vδEBuild (rebuild core) ----
// vδEBuild builds vδE from vδZ for file.
//
// XXX place ok?
func
vδEBuild
(
foid
zodb
.
Oid
,
δZtail
*
zodb
.
ΔTail
,
db
*
zodb
.
DB
)
(
vδE
[]
_ΔFileEpoch
,
err
error
)
{
defer
xerr
.
Contextf
(
&
err
,
"file<%s>: build vδE"
,
foid
)
vδE
=
[]
_ΔFileEpoch
{}
vδZ
:=
δZtail
.
Data
()
atPrev
:=
δZtail
.
Tail
()
for
i
:=
0
;
i
<
len
(
vδZ
);
i
++
{
δZ
:=
vδZ
[
i
]
fchanged
:=
false
for
_
,
oid
:=
range
δZ
.
Changev
{
if
oid
==
foid
{
fchanged
=
true
break
}
}
if
!
fchanged
{
continue
}
δ
,
err
:=
zfilediff
(
db
,
foid
,
atPrev
,
δZ
.
Rev
)
if
err
!=
nil
{
return
nil
,
err
}
if
δ
!=
nil
{
δE
:=
_ΔFileEpoch
{
Rev
:
δZ
.
Rev
,
oldRoot
:
δ
.
blktabOld
,
newRoot
:
δ
.
blktabNew
,
oldBlkSize
:
δ
.
blksizeOld
,
newBlkSize
:
δ
.
blksizeNew
,
oldTrackSetZBlk
:
nil
,
// nothing was tracked
}
vδE
=
append
(
vδE
,
δE
)
}
atPrev
=
δZ
.
Rev
}
return
vδE
,
nil
}
// zfilediff returns direct difference for ZBigFile<foid> old..new .
...
...
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