Commit 102afd99 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent c0d4586b
...@@ -183,100 +183,6 @@ func zodbDump(w io.Writer, stor zodb.IStorage, tidMin, tidMax zodb.Tid, hashOnly ...@@ -183,100 +183,6 @@ func zodbDump(w io.Writer, stor zodb.IStorage, tidMin, tidMax zodb.Tid, hashOnly
} }
/*
func zodbDump(w io.Writer, stor zodb.IStorage, tidMin, tidMax zodb.Tid, hashOnly bool) error {
var retErr error
iter := stor.Iterate(tidMin, tidMax)
// XXX error handling -> exceptions ?
// transactions
first := true
for {
txni, dataIter, err := iter.NextTxn()
if err != nil {
if err == io.EOF {
break
}
retErr = err
break
}
// LF in-between txn records
vskip := "\n"
if first {
vskip = ""
first = false
}
_, err = fmt.Fprintf(w, "%stxn %s (%c)\nuser %q\ndescription %q\nextension %q\n",
vskip, txni.Tid, txni.Status, txni.User, txni.Description, txni.Extension)
if err != nil {
retErr = err
break
}
// data records
for {
datai, err := dataIter.NextData()
if err != nil {
if err == io.EOF {
break
}
retErr = err
goto out
}
entry := "obj " + datai.Oid.String() + " "
writeData := false
switch {
case datai.Data == nil:
entry += "delete"
case datai.Tid != datai.DataTid:
entry += "from " + datai.DataTid.String()
default:
entry += fmt.Sprintf("%d sha1:%x", len(datai.Data), sha1.Sum(datai.Data))
writeData = true
}
entry += "\n"
_, err = w.Write(mem.Bytes(entry))
if err != nil {
retErr = err
goto out
}
if !hashOnly && writeData {
_, err = w.Write(datai.Data)
if err != nil {
retErr = err
goto out
}
_, err = w.Write([]byte("\n"))
if err != nil {
retErr = err
goto out
}
}
}
}
out:
if retErr != nil {
return fmt.Errorf("%s: dumping %v..%v: %v", stor, tidMin, tidMax, retErr)
}
return nil
}
*/
func usage() { func usage() {
fmt.Fprintf(os.Stderr, fmt.Fprintf(os.Stderr,
`zodbdump [options] <storage> [tidmin..tidmax] `zodbdump [options] <storage> [tidmin..tidmax]
......
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