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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
34 deletions
+48
-34
wcfs/internal/zdata/δftail.go
wcfs/internal/zdata/δftail.go
+48
-34
No files found.
wcfs/internal/zdata/δftail.go
View file @
8316aa92
...
@@ -339,43 +339,11 @@ func (δftail *_ΔFileTail) _rebuild1(foid zodb.Oid, δZtail *zodb.ΔTail, db *z
...
@@ -339,43 +339,11 @@ func (δftail *_ΔFileTail) _rebuild1(foid zodb.Oid, δZtail *zodb.ΔTail, db *z
panic
(
"rebuild1: vδE != nil"
)
panic
(
"rebuild1: vδE != nil"
)
}
}
vδE
:=
[]
_ΔFileEpoch
{}
vδE
,
err
:=
vδEBuild
(
foid
,
δZtail
,
db
)
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
{
if
err
!=
nil
{
return
err
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
}
δftail
.
vδE
=
vδE
δftail
.
vδE
=
vδE
return
nil
return
nil
}
}
...
@@ -971,7 +939,53 @@ func (δFtail *ΔFtail) _BlkRevAt(ctx context.Context, zfile *ZBigFile, blk int6
...
@@ -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 .
// 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