Commit 877e64a9 authored by Kirill Smelkov's avatar Kirill Smelkov

X wcfs: Fix tests to pass again

I broke wcfs test while trying to implement rebuild.
Keep wcfs tests passing while rebuild is not finished yet.
parent b9c8716e
......@@ -32,6 +32,10 @@ import (
"lab.nexedi.com/nexedi/wendelin.core/wcfs/internal/xtail"
)
// XXX malfancitioning rebuild currently breaks wcfs tests
// TODO kill this after rebuild is finished
const XXX_killWhenRebuildWorks = true
// ΔBtail represents tail of revisional changes to BTrees.
//
// It semantically consists of
......@@ -248,6 +252,13 @@ func (δBtail *ΔBtail) Track(key Key, keyPresent bool, path []Node) error { //
}
}
// XXX hack - until rebuild is implemented
if XXX_killWhenRebuildWorks {
_, ok := δBtail.byRoot[root]
if !ok {
δBtail.byRoot[root] = newΔTtail()
}
}
// XXX update diff XXX here? or as separate step?
// XXX update lastRevOf
......@@ -396,11 +407,18 @@ func (δBtail *ΔBtail) Update(δZ *zodb.EventCommit) (_ ΔB, err error) {
headOld := δBtail.Head()
defer xerr.Contextf(&err, "ΔBtail update %s -> %s", headOld, δZ.Tid)
if XXX_killWhenRebuildWorks {
// XXX hack - until vvv is reenabled
δBtail.trackSet.UnionInplace(δBtail.trackNew)
δBtail.trackNew = PPTreeSubSet{}
} else {
// XXX reenable (currently breaks wcfs tests)
// update .trackSet and vδB from .trackNew
err = δBtail.rebuild()
if err != nil {
return ΔB{}, err
}
}
tracef("Update @%s -> @%s\n", δBtail.Head(), δZ.Tid)
tracef("δZ:\t%v\n", δZ.Changev)
......
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