Commit 84845c97 authored by Kirill Smelkov's avatar Kirill Smelkov

go/zodb/zodbtools: Regenerate test data + fix

The only change is extra LF that is appended to end of 1.zdump.pyok due
to nexedi/zodbtools@624aeb09.

Correspondingly fix dump on zodbtools/go side.
parent 968f9555
// Copyright (C) 2016-2019 Nexedi SA and Contributors. // Copyright (C) 2016-2020 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com> // Kirill Smelkov <kirr@nexedi.com>
// //
// This program is free software: you can Use, Study, Modify and Redistribute // This program is free software: you can Use, Study, Modify and Redistribute
...@@ -72,8 +72,6 @@ type dumper struct { ...@@ -72,8 +72,6 @@ type dumper struct {
W io.Writer W io.Writer
HashOnly bool // whether to dump only hashes of data without content HashOnly bool // whether to dump only hashes of data without content
afterFirst bool // true after first transaction has been dumped
buf xfmt.Buffer // reusable data buffer for formatting buf xfmt.Buffer // reusable data buffer for formatting
} }
...@@ -152,15 +150,8 @@ func (d *dumper) DumpTxn(ctx context.Context, txni *zodb.TxnInfo, dataIter zodb. ...@@ -152,15 +150,8 @@ func (d *dumper) DumpTxn(ctx context.Context, txni *zodb.TxnInfo, dataIter zodb.
var datai *zodb.DataInfo var datai *zodb.DataInfo
// LF in-between txn records _, err = fmt.Fprintf(d.W, "txn %s %q\nuser %q\ndescription %q\nextension %q\n",
vskip := "\n" txni.Tid, string(txni.Status), txni.User, txni.Description, txni.Extension)
if !d.afterFirst {
vskip = ""
d.afterFirst = true
}
_, err = fmt.Fprintf(d.W, "%stxn %s %q\nuser %q\ndescription %q\nextension %q\n",
vskip, txni.Tid, string(txni.Status), txni.User, txni.Description, txni.Extension)
if err != nil { if err != nil {
return err return err
} }
...@@ -170,18 +161,19 @@ func (d *dumper) DumpTxn(ctx context.Context, txni *zodb.TxnInfo, dataIter zodb. ...@@ -170,18 +161,19 @@ func (d *dumper) DumpTxn(ctx context.Context, txni *zodb.TxnInfo, dataIter zodb.
datai, err = dataIter.NextData(ctx) datai, err = dataIter.NextData(ctx)
if err != nil { if err != nil {
if err == io.EOF { if err == io.EOF {
err = nil // XXX -> okEOF ? break
} }
break return err
} }
err = d.DumpData(datai) err = d.DumpData(datai)
if err != nil { if err != nil {
break return err
} }
} }
_, err = d.W.Write(_LF)
return err return err
} }
......
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