tests/wireprotohelpers.sh
author Raphaël Gomès <rgomes@octobus.net>
Tue, 05 Apr 2022 17:11:36 +0200
branchstable
changeset 49006 5bd6bcd31dd1
parent 48526 04688c51f81f
permissions -rw-r--r--
relnotes: add notes for 6.1.1 This also fixes the header for 6.1 from 6.1rc0

MEDIATYPE=application/mercurial-exp-framing-0006

sendhttpraw() {
  hg --verbose debugwireproto --peer raw http://$LOCALIP:$HGPORT/
}

cat > dummycommands.py << EOF
from mercurial import (
    wireprototypes,
    wireprotov1server,
)

@wireprotov1server.wireprotocommand(b'customreadonly', permission=b'pull')
def customreadonlyv1(repo, proto):
    return wireprototypes.bytesresponse(b'customreadonly bytes response')

@wireprotov1server.wireprotocommand(b'customreadwrite', permission=b'push')
def customreadwrite(repo, proto):
    return wireprototypes.bytesresponse(b'customreadwrite bytes response')

EOF

cat >> $HGRCPATH << EOF
[extensions]
drawdag = $TESTDIR/drawdag.py
EOF

enabledummycommands() {
  cat >> $HGRCPATH << EOF
[extensions]
dummycommands = $TESTTMP/dummycommands.py
EOF
}