Commit ab729680 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent ed46529d
...@@ -102,7 +102,7 @@ type ZRawObject struct { // keep in sync with zodb(test).ZRawObject ...@@ -102,7 +102,7 @@ type ZRawObject struct { // keep in sync with zodb(test).ZRawObject
// ZPyCommitRaw commits new transaction into database @ zurl with raw data specified by objv. // ZPyCommitRaw commits new transaction into database @ zurl with raw data specified by objv.
// //
// Empty data means "delete object". // Nil data means "delete object".
// The commit is performed via zodbtools/py. // The commit is performed via zodbtools/py.
func ZPyCommitRaw(zurl string, at zodb.Tid, objv ...ZRawObject) (_ zodb.Tid, err error) { func ZPyCommitRaw(zurl string, at zodb.Tid, objv ...ZRawObject) (_ zodb.Tid, err error) {
defer xerr.Contextf(&err, "%s: zpycommit @%s", zurl, at) defer xerr.Contextf(&err, "%s: zpycommit @%s", zurl, at)
...@@ -114,7 +114,7 @@ func ZPyCommitRaw(zurl string, at zodb.Tid, objv ...ZRawObject) (_ zodb.Tid, err ...@@ -114,7 +114,7 @@ func ZPyCommitRaw(zurl string, at zodb.Tid, objv ...ZRawObject) (_ zodb.Tid, err
fmt.Fprintf(zin, "extension %q\n", "") fmt.Fprintf(zin, "extension %q\n", "")
for _, obj := range objv { for _, obj := range objv {
// !data -> delete // !data -> delete
if len(obj.Data) == 0 { if obj.Data == nil {
fmt.Fprintf(zin, "obj %s delete\n", obj.Oid) fmt.Fprintf(zin, "obj %s delete\n", obj.Oid)
} else { } else {
fmt.Fprintf(zin, "obj %s %d null:00\n", obj.Oid, len(obj.Data)) fmt.Fprintf(zin, "obj %s %d null:00\n", obj.Oid, len(obj.Data))
......
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