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
35a0803c
Commit
35a0803c
authored
Mar 06, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
db60a77f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
t/neo/zodb/cmd/zodbdump/zodbdump.go
t/neo/zodb/cmd/zodbdump/zodbdump.go
+13
-8
t/neo/zodb/str.go
t/neo/zodb/str.go
+1
-0
No files found.
t/neo/zodb/cmd/zodbdump/zodbdump.go
View file @
35a0803c
...
@@ -38,6 +38,7 @@ import (
...
@@ -38,6 +38,7 @@ import (
"os"
"os"
"../../../zodb"
"../../../zodb"
"../../../storage/fs1"
"lab.nexedi.com/kirr/go123/mem"
"lab.nexedi.com/kirr/go123/mem"
"lab.nexedi.com/kirr/go123/xio"
"lab.nexedi.com/kirr/go123/xio"
...
@@ -109,7 +110,7 @@ func zodbDump(w io.Writer, stor zodb.IStorage, tidMin, tidMax zodb.Tid, hashOnly
...
@@ -109,7 +110,7 @@ func zodbDump(w io.Writer, stor zodb.IStorage, tidMin, tidMax zodb.Tid, hashOnly
func
usage
()
{
func
usage
()
{
fmt
.
Fprintf
(
os
.
Stderr
,
fmt
.
Fprintf
(
os
.
Stderr
,
`zodbdump [options] <
command
> [tidmin..tidmax]
`zodbdump [options] <
storage
> [tidmin..tidmax]
Dump content of a ZODB database.
Dump content of a ZODB database.
<storage> is a path to FileStorage XXX will become URL
<storage> is a path to FileStorage XXX will become URL
...
@@ -123,8 +124,7 @@ Dump content of a ZODB database.
...
@@ -123,8 +124,7 @@ Dump content of a ZODB database.
func
main
()
{
func
main
()
{
hashOnly
:=
false
hashOnly
:=
false
tidMin
:=
zodb
.
Tid
(
0
)
tidRange
:=
".."
// (0, +inf)
tidMax
:=
zodb
.
TidMax
flag
.
Usage
=
usage
flag
.
Usage
=
usage
flag
.
BoolVar
(
&
hashOnly
,
"hashonly"
,
hashOnly
,
"dump only hashes of objects"
)
flag
.
BoolVar
(
&
hashOnly
,
"hashonly"
,
hashOnly
,
"dump only hashes of objects"
)
...
@@ -137,14 +137,19 @@ func main() {
...
@@ -137,14 +137,19 @@ func main() {
}
}
storUrl
:=
argv
[
0
]
storUrl
:=
argv
[
0
]
var
err
error
if
len
(
argv
)
>
1
{
if
len
(
argv
)
>
1
{
tidMin
,
tidMax
,
err
=
parseTidRange
(
argv
[
1
])
tidRange
=
argv
[
1
]
if
err
!=
nil
{
}
log
.
Fatal
(
err
)
// XXX recheck
}
tidMin
,
tidMax
,
err
:=
zodb
.
ParseTidRange
(
tidRange
)
if
err
!=
nil
{
log
.
Fatal
(
err
)
// XXX recheck
}
}
stor
,
err
=
fs1
.
Open
(
storUrl
)
// TODO read-only
stor
,
err
:
=
fs1
.
Open
(
storUrl
)
// TODO read-only
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Fatal
(
err
)
log
.
Fatal
(
err
)
}
}
...
...
t/neo/zodb/str.go
View file @
35a0803c
...
@@ -69,6 +69,7 @@ func ParseOid(s string) (Oid, error) {
...
@@ -69,6 +69,7 @@ func ParseOid(s string) (Oid, error) {
// ParseTidRange parses string of form "<tidmin>..<tidmax>" into tidMin, tidMax pair
// ParseTidRange parses string of form "<tidmin>..<tidmax>" into tidMin, tidMax pair
// both <tidmin> and <tidmax> can be empty, in which case defaults 0 and TidMax are returned
// both <tidmin> and <tidmax> can be empty, in which case defaults 0 and TidMax are returned
// XXX also check tidMin < tidMax here? or allow reverse ranges ?
func
ParseTidRange
(
s
string
)
(
tidMin
,
tidMax
Tid
,
err
error
)
{
func
ParseTidRange
(
s
string
)
(
tidMin
,
tidMax
Tid
,
err
error
)
{
s1
,
s2
,
err
:=
xstrings
.
Split2
(
s
,
".."
)
s1
,
s2
,
err
:=
xstrings
.
Split2
(
s
,
".."
)
if
err
!=
nil
{
if
err
!=
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