Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
f2d64242
Commit
f2d64242
authored
Mar 06, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
35a0803c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
8 deletions
+20
-8
t/neo/zodb/cmd/zodbdump/zodbdump.go
t/neo/zodb/cmd/zodbdump/zodbdump.go
+20
-8
No files found.
t/neo/zodb/cmd/zodbdump/zodbdump.go
View file @
f2d64242
...
...
@@ -41,17 +41,24 @@ import (
"../../../storage/fs1"
"lab.nexedi.com/kirr/go123/mem"
"lab.nexedi.com/kirr/go123/xio"
//
"lab.nexedi.com/kirr/go123/xio"
)
// zodbDump dumps contents of a storage in between tidMin..tidMax range to a writer.
// see top-level documentation for the dump format.
func
zodbDump
(
w
io
.
Writer
,
stor
zodb
.
IStorage
,
tidMin
,
tidMax
zodb
.
Tid
,
hashOnly
bool
)
error
{
var
retErr
error
iter
:=
stor
.
Iterate
(
tidMin
,
tidMax
)
for
{
txni
,
dataIter
,
err
:=
iter
.
NextTxn
()
if
err
!=
nil
{
err
=
xio
.
OkEOF
(
err
)
break
if
err
==
io
.
EOF
{
break
}
retErr
=
err
goto
out
}
// TODO if not first: println
...
...
@@ -66,8 +73,12 @@ func zodbDump(w io.Writer, stor zodb.IStorage, tidMin, tidMax zodb.Tid, hashOnly
for
{
datai
,
err
:=
dataIter
.
NextData
()
if
err
!=
nil
{
err
=
xio
.
OkEOF
(
err
)
break
if
err
==
io
.
EOF
{
break
}
retErr
=
err
goto
out
}
entry
:=
"obj "
+
datai
.
Oid
.
String
()
+
" "
...
...
@@ -99,11 +110,12 @@ func zodbDump(w io.Writer, stor zodb.IStorage, tidMin, tidMax zodb.Tid, hashOnly
}
}
// XXX check err
}
// XXX check err
out
:
if
retErr
!=
nil
{
return
fmt
.
Errorf
(
"%s: dump %v..%v: %v"
,
stor
,
tidMin
,
tidMax
,
retErr
)
}
return
nil
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment