wireprotohelpers.sh
34 lines
| 795 B
| application/x-sh
|
BashLexer
/ tests / wireprotohelpers.sh
Gregory Szorc
|
r40168 | MEDIATYPE=application/mercurial-exp-framing-0006 | ||
Gregory Szorc
|
r37500 | |||
sendhttpraw() { | ||||
hg --verbose debugwireproto --peer raw http://$LOCALIP:$HGPORT/ | ||||
} | ||||
cat > dummycommands.py << EOF | ||||
from mercurial import ( | ||||
wireprototypes, | ||||
Gregory Szorc
|
r37803 | wireprotov1server, | ||
Gregory Szorc
|
r37500 | ) | ||
Augie Fackler
|
r39096 | @wireprotov1server.wireprotocommand(b'customreadonly', permission=b'pull') | ||
Gregory Szorc
|
r37558 | def customreadonlyv1(repo, proto): | ||
return wireprototypes.bytesresponse(b'customreadonly bytes response') | ||||
Augie Fackler
|
r39096 | @wireprotov1server.wireprotocommand(b'customreadwrite', permission=b'push') | ||
Gregory Szorc
|
r37500 | def customreadwrite(repo, proto): | ||
return wireprototypes.bytesresponse(b'customreadwrite bytes response') | ||||
Gregory Szorc
|
r37558 | |||
Gregory Szorc
|
r37500 | EOF | ||
cat >> $HGRCPATH << EOF | ||||
[extensions] | ||||
drawdag = $TESTDIR/drawdag.py | ||||
EOF | ||||
enabledummycommands() { | ||||
cat >> $HGRCPATH << EOF | ||||
[extensions] | ||||
dummycommands = $TESTTMP/dummycommands.py | ||||
EOF | ||||
} | ||||