Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
5e172c1c
Commit
5e172c1c
authored
May 29, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
02db2a48
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
1 deletion
+31
-1
wcfs/testprog/treegen.py
wcfs/testprog/treegen.py
+2
-0
wcfs/δbtail_test.go
wcfs/δbtail_test.go
+29
-1
No files found.
wcfs/testprog/treegen.py
View file @
5e172c1c
...
...
@@ -156,6 +156,8 @@ def Trees(zstor, r):
trees
=
zctx
.
root
[
'treegen/trees'
]
=
PersistentMapping
()
commit
(
'treegen/trees: init'
)
print
(
"start @%s tree=%s"
%
(
ashex
(
XXX
),
ashex
(
XXX
))
while
1
:
treetxt
=
r
.
readline
()
if
treetxt
==
''
:
...
...
wcfs/δbtail_test.go
View file @
5e172c1c
...
...
@@ -25,6 +25,7 @@ import (
"io"
"os"
"os/exec"
"regexp"
"strings"
"testing"
...
...
@@ -43,6 +44,7 @@ type TreeGen struct {
pyoutRaw
*
io
.
PipeReader
// output from pysrv
pyout
*
bufio
.
Reader
// buffered ^^^
treeRoot
zodb
.
Oid
// oid of the tree treegen works on
head
zodb
.
Tid
// last made commit
}
// StartTreeGen spawns `treegen trees` server.
...
...
@@ -61,7 +63,33 @@ func StartTreeGen(zurl string) (_ *TreeGen, err error) {
return
nil
,
err
}
// XXX wait for init message and set .treeRoot
// wait for init message and set .treeRoot
defer
func
()
{
if
err
!=
nil
{
tg
.
Close
()
// ignore error
}
}()
defer
xerr
.
Context
(
&
err
,
"handshake"
)
start
,
err
:=
tg
.
pyout
.
ReadString
(
'\n'
)
if
err
!=
nil
{
return
nil
,
err
}
// start @<at> tree=<root>
startRe
:=
regexp
.
MustCompile
(
`^start @([^ ]+) root=([^ ]+)$`
)
m
:=
startRe
.
FindStringSubmatch
(
start
)
if
m
==
nil
{
return
nil
,
fmt
.
Errorf
(
"invalid start %q"
,
start
)
}
tg
.
head
,
err
=
zodb
.
ParseTid
(
m
[
1
])
// <at>
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"invalid start %q: tid: %s"
,
start
,
err
)
}
tg
.
treeRoot
,
err
=
zodb
.
ParseOid
(
m
[
2
])
// <root>
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"invalid start %q: root: %s"
,
start
,
err
)
}
return
tg
,
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