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
b9efd0b5
Commit
b9efd0b5
authored
May 24, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
8708ccde
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
7 deletions
+16
-7
go/internal/xtesting/xtesting.go
go/internal/xtesting/xtesting.go
+3
-3
go/zodb/pydata.go
go/zodb/pydata.go
+1
-1
go/zodb/storage/fs1/format.go
go/zodb/storage/fs1/format.go
+7
-2
go/zodb/storage/fs1/fs1tools/dump_test.go
go/zodb/storage/fs1/fs1tools/dump_test.go
+2
-0
go/zodb/zodbtools/dump_test.go
go/zodb/zodbtools/dump_test.go
+2
-0
go/zodb/δtail.go
go/zodb/δtail.go
+1
-1
No files found.
go/internal/xtesting/xtesting.go
View file @
b9efd0b5
...
...
@@ -55,7 +55,7 @@ func NeedPy(t testing.TB, modules ...string) {
// verify if python is present
havePy
,
know
:=
pyHave
[
".python"
]
if
!
know
{
cmd
:=
exec
.
Command
(
"python
2
"
,
"-c"
,
"0"
)
cmd
:=
exec
.
Command
(
"python"
,
"-c"
,
"0"
)
err
:=
cmd
.
Run
()
havePy
=
(
err
==
nil
)
pyHave
[
".python"
]
=
havePy
...
...
@@ -69,7 +69,7 @@ func NeedPy(t testing.TB, modules ...string) {
for
_
,
pymod
:=
range
modules
{
have
,
know
:=
pyHave
[
pymod
]
if
!
know
{
cmd
:=
exec
.
Command
(
"python
2
"
,
"-c"
,
"import "
+
pymod
)
cmd
:=
exec
.
Command
(
"python"
,
"-c"
,
"import "
+
pymod
)
err
:=
cmd
.
Run
()
have
=
(
err
==
nil
)
pyHave
[
pymod
]
=
have
...
...
@@ -112,7 +112,7 @@ func ZPyCommitRaw(zurl string, at zodb.Tid, objv ...ZRawObject) (_ zodb.Tid, err
zin
.
WriteString
(
"
\n
"
)
// run py `zodb commit`
cmd
:=
exec
.
Command
(
"python
2
"
,
"-m"
,
"zodbtools.zodb"
,
"commit"
,
zurl
,
at
.
String
())
cmd
:=
exec
.
Command
(
"python"
,
"-m"
,
"zodbtools.zodb"
,
"commit"
,
zurl
,
at
.
String
())
cmd
.
Stdin
=
zin
cmd
.
Stderr
=
os
.
Stderr
out
,
err
:=
cmd
.
Output
()
...
...
go/zodb/pydata.go
View file @
b9efd0b5
...
...
@@ -69,7 +69,7 @@ func encodePyData(pyclass pickle.Class, pystate interface{}) PyData {
p
:=
pickle
.
NewEncoderWithConfig
(
buf
,
&
pickle
.
EncoderConfig
{
// allow pristine python2 to decode the pickle.
// TODO 2 -> 3 since ZODB5 switched to it and uses zodbpickle.
Protocol
:
2
,
Protocol
:
2
,
// XXX -> 3?
PersistentRef
:
persistentRef
,
})
...
...
go/zodb/storage/fs1/format.go
View file @
b9efd0b5
...
...
@@ -68,7 +68,8 @@ type DataHeader struct {
}
const
(
Magic
=
"FS21"
// every FileStorage file starts with this
Magic21
=
"FS21"
// FileStorage file produced by Python2 starts with this
Magic30
=
"FS30"
// ----//---- by Python3 XXX +test
// on-disk sizes
FileHeaderSize
=
4
...
...
@@ -154,8 +155,12 @@ func (fh *FileHeader) Load(r io.ReaderAt) error {
if
err
!=
nil
{
return
fmt
.
Errorf
(
"%sread magic: %s"
,
ioprefix
(
r
),
err
)
}
if
string
(
fh
.
Magic
[
:
])
!=
Magic
{
switch
string
(
fh
.
Magic
[
:
])
{
default
:
return
fmt
.
Errorf
(
"%sinvalid fs1 magic %q"
,
ioprefix
(
r
),
fh
.
Magic
)
case
Magic21
,
Magic30
:
// ok XXX do we need to distinguish them somehow?
}
return
nil
...
...
go/zodb/storage/fs1/fs1tools/dump_test.go
View file @
b9efd0b5
...
...
@@ -19,6 +19,8 @@
package
fs1tools
// XXX + py3
//go:generate sh -c "python2 -m ZODB.scripts.fstail -n 1000000 ../testdata/1.fs >testdata/1.fstail.ok"
//go:generate sh -c "python2 -c 'from ZODB.FileStorage import fsdump; fsdump.main()' ../testdata/1.fs >testdata/1.fsdump.ok"
//go:generate sh -c "python2 -c 'from ZODB.FileStorage.fsdump import Dumper; import sys; d = Dumper(sys.argv[1]); d.dump()' ../testdata/1.fs >testdata/1.fsdumpv.ok"
...
...
go/zodb/zodbtools/dump_test.go
View file @
b9efd0b5
...
...
@@ -19,6 +19,8 @@
package
zodbtools
// XXX +py3 ?
//go:generate sh -c "python2 -m zodbtools.zodb dump ../../zodb/storage/fs1/testdata/1.fs >testdata/1.zdump.pyok"
//go:generate sh -c "python2 -m zodbtools.zodb dump ../../zodb/storage/fs1/testdata/empty.fs >testdata/empty.zdump.pyok"
...
...
go/zodb/δtail.go
View file @
b9efd0b5
...
...
@@ -118,7 +118,7 @@ func (δtail *ΔTail) Tail() Tid {
//
// Note: contrary to regular go slicing, low is exclusive while high is inclusive.
func
(
δtail
*
ΔTail
)
SliceByRev
(
low
,
high
Tid
)
/*readonly*/
[]
ΔRevEntry
{
tail
:=
δtail
.
Tail
()
tail
:=
δtail
.
tail
head
:=
δtail
.
head
if
!
(
tail
<=
low
&&
low
<=
high
&&
high
<=
head
)
{
panic
(
fmt
.
Sprintf
(
"δtail.Slice: invalid query: (%s, %s]; (tail, head] = (%s, %s]"
,
low
,
high
,
tail
,
head
))
...
...
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