Commit 2a8b0802 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 16571605
......@@ -330,9 +330,10 @@ func (δFtail *ΔFtail) Update(δZ *zodb.EventCommit) (_ ΔF, err error) {
δfile.Blocks = nil
δfile.Size = false
// XXX + rebuild XXX not here - in track(new file)
_ = δ
//fmt.Printf("δZBigFile: %v\n", δ)
//return ΔF{}, fmt.Errorf("ZBigFile<%s> changed @%s", oid, δZ.Tid)
}
// fmt.Printf("-> δF: %v\n", δF)
......@@ -538,7 +539,7 @@ func (δFtail *ΔFtail) LastBlkRev(ctx context.Context, zf *ZBigFile, blk int64,
// ----------------------------------------
// zfilediff ... XXX
// zfilediff returns direct difference for ZBigFile<foid> old..new .
type _ΔZBigFile struct {
blksizeOld, blksizeNew int64
blktabOld, blktabNew zodb.Oid
......@@ -565,7 +566,7 @@ func zfilediff(db *zodb.DB, foid zodb.Oid, old, new zodb.Tid) (δ *_ΔZBigFile,
return diffF(ctx, a, b)
}
// diffF computes direct difference in between two ZBigFile objects.
// diffF returns direct difference in between two ZBigFile objects.
func diffF(ctx context.Context, a, b *ZBigFile) (δ *_ΔZBigFile, err error) {
defer xerr.Contextf(&err, "diffF %s %s", xzodb.XidOf(a), xzodb.XidOf(b))
......
......@@ -256,9 +256,8 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
if epoch {
blkTab = map[int64]string{}
Zinblk = map[string]setI64{}
}
// XXX else?
δblk = nil
} else {
// rebuild blkTab/Zinblk
for blk, zblk := range test.δblkTab {
zprev, ok := blkTab[blk]
......@@ -301,6 +300,7 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
δblk.Add(blk)
}
}
}
// commit updated zfile / blkTab + dataTab
var req string
......@@ -337,10 +337,10 @@ func testΔFtail(t_ *testing.T, testq chan ΔFTestEntry) {
err = zconn.Resync(ctx, commit.At); X(err)
var δfok *ΔFile
if len(δblk) != 0 {
if epoch || len(δblk) != 0 {
δfok = &ΔFile{
Rev: commit.At,
Epoch: epoch, // XXX epoch -> blocks/size = nil ?
Epoch: epoch,
Blocks: δblk,
Size: δtree, // not strictly ok, but matches current ΔFtail code
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment