##// END OF EJS Templates
Issue937: error messages from hooks not sent over HTTP....
Issue937: error messages from hooks not sent over HTTP. Turns out that stderr - where ui.warn would send messages - was not being proxied over the HTTP connection. stdout was, and it seems you need both. (The streams are interleaved for readability.) Tested on Ubuntu 7.10 with lighttpd on hgweb.cgi with HTTP Basic auth, no SSL, using a changeset failing win32text.forbidcrlf.

File last commit:

r5978:7939c71f default
r6265:be76e545 default
Show More
test-ssh
111 lines | 2.3 KiB | text/plain | TextLexer
mpm@selenic.com
Add a simple dummy ssh test...
r1110 #!/bin/sh
Alexis S. L. Carvalho
test-ssh: use printenv.py
r4291 cp "$TESTDIR"/printenv.py .
mpm@selenic.com
Add a simple dummy ssh test...
r1110 # This test tries to exercise the ssh functionality with a dummy script
Alexis S. L. Carvalho
test-ssh: avoid a shell script
r4298 cat <<EOF > dummyssh
import sys
import os
mpm@selenic.com
Add a simple dummy ssh test...
r1110
Alexis S. L. Carvalho
test-ssh: avoid a shell script
r4298 os.chdir(os.path.dirname(sys.argv[0]))
if sys.argv[1] != "user@dummy":
sys.exit(-1)
if not os.path.exists("dummyssh"):
sys.exit(-1)
mpm@selenic.com
Add a simple dummy ssh test...
r1110
Alexis S. L. Carvalho
test-ssh: avoid a shell script
r4298 os.environ["SSH_CLIENT"] = "127.0.0.1 1 2"
mpm@selenic.com
Add a simple dummy ssh test...
r1110
Alexis S. L. Carvalho
test-ssh: avoid a shell script
r4298 log = open("dummylog", "ab")
log.write("Got arguments")
for i, arg in enumerate(sys.argv[1:]):
log.write(" %d:%s" % (i+1, arg))
log.write("\n")
log.close()
r = os.system(sys.argv[2])
sys.exit(bool(r))
mpm@selenic.com
Add a simple dummy ssh test...
r1110 EOF
Alexis S. L. Carvalho
sshrepo: be more careful while reading data...
r5978 cat <<EOF > badhook
import sys
sys.stdout.write("KABOOM")
EOF
mpm@selenic.com
Add a simple dummy ssh test...
r1110 echo "# creating 'remote'"
hg init remote
cd remote
echo this > foo
Benoit Boissinot
switch to the .hg/store layout, fix the tests
r3853 echo this > fooO
hg ci -A -m "init" -d "1000000 0" foo fooO
Vadim Gelfer
clone: disable stream support on server side by default....
r2621 echo '[server]' > .hg/hgrc
Vadim Gelfer
rename stream hgrc option to compressed.
r2622 echo 'uncompressed = True' >> .hg/hgrc
Vadim Gelfer
hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks...
r2673 echo '[hooks]' >> .hg/hgrc
Alexis S. L. Carvalho
test-ssh: use printenv.py
r4291 echo 'changegroup = python ../printenv.py changegroup-in-remote 0 ../dummylog' >> .hg/hgrc
mpm@selenic.com
Add a simple dummy ssh test...
r1110
cd ..
Benoit Boissinot
ssh: make the error message more clear, add a testcase
r3275 echo "# repo not found error"
Alexis S. L. Carvalho
test-ssh: avoid a shell script
r4298 hg clone -e "python ./dummyssh" ssh://user@dummy/nonexistent local
Benoit Boissinot
ssh: make the error message more clear, add a testcase
r3275
Vadim Gelfer
add support for streaming clone....
r2612 echo "# clone remote via stream"
Alexis S. L. Carvalho
test-ssh: avoid a shell script
r4298 hg clone -e "python ./dummyssh" --uncompressed ssh://user@dummy/remote local-stream 2>&1 | \
Lee Cantey
Allow for MB/sec transfer rates in test-http-proxy and test-ssh....
r3015 sed -e 's/[0-9][0-9.]*/XXX/g' -e 's/[KM]\(B\/sec\)/X\1/'
Vadim Gelfer
add support for streaming clone....
r2612 cd local-stream
hg verify
cd ..
echo "# clone remote via pull"
Alexis S. L. Carvalho
test-ssh: avoid a shell script
r4298 hg clone -e "python ./dummyssh" ssh://user@dummy/remote local
mpm@selenic.com
Add a simple dummy ssh test...
r1110
echo "# verify"
cd local
hg verify
Vadim Gelfer
hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks...
r2673 echo '[hooks]' >> .hg/hgrc
Alexis S. L. Carvalho
test-ssh: use printenv.py
r4291 echo 'changegroup = python ../printenv.py changegroup-in-local 0 ../dummylog' >> .hg/hgrc
Vadim Gelfer
hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks...
r2673
mpm@selenic.com
Add a simple dummy ssh test...
r1110 echo "# empty default pull"
hg paths
Alexis S. L. Carvalho
test-ssh: avoid a shell script
r4298 hg pull -e "python ../dummyssh"
mpm@selenic.com
Add a simple dummy ssh test...
r1110
echo "# local change"
echo bleah > foo
Thomas Arendsen Hein
Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero....
r1933 hg ci -m "add" -d "1000000 0"
mpm@selenic.com
Add a simple dummy ssh test...
r1110
echo "# updating rc"
echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
echo "[ui]" >> .hg/hgrc
Alexis S. L. Carvalho
test-ssh: avoid a shell script
r4298 echo "ssh = python ../dummyssh" >> .hg/hgrc
mpm@selenic.com
Add a simple dummy ssh test...
r1110
echo "# find outgoing"
hg out ssh://user@dummy/remote
Thomas Arendsen Hein
Added test for incoming via ssh.
r1982 echo "# find incoming on the remote side"
Alexis S. L. Carvalho
test-ssh: avoid a shell script
r4298 hg incoming -R ../remote -e "python ../dummyssh" ssh://user@dummy/local
Thomas Arendsen Hein
Added test for incoming via ssh.
r1982
mpm@selenic.com
Add a simple dummy ssh test...
r1110 echo "# push"
hg push
cd ../remote
echo "# check remote tip"
hg tip
hg verify
Brendan Cully
cat: default to working dir parent instead of tip...
r3095 hg cat -r tip foo
mpm@selenic.com
Add a simple dummy ssh test...
r1110
Vadim Gelfer
extend network protocol to stop clients from locking servers...
r2439 echo z > z
hg ci -A -m z -d '1000001 0' z
Alexis S. L. Carvalho
sshrepo: be more careful while reading data...
r5978 # a bad, evil hook that prints to stdout
echo 'changegroup.stdout = python ../badhook' >> .hg/hgrc
Vadim Gelfer
extend network protocol to stop clients from locking servers...
r2439
cd ../local
echo r > r
hg ci -A -m z -d '1000002 0' r
Alexis S. L. Carvalho
sshrepo: be more careful while reading data...
r5978 echo "# push should succeed even though it has an unexpected response"
Vadim Gelfer
extend network protocol to stop clients from locking servers...
r2439 hg push
Alexis S. L. Carvalho
sshrepo: be more careful while reading data...
r5978 hg -R ../remote heads
Vadim Gelfer
extend network protocol to stop clients from locking servers...
r2439
mpm@selenic.com
Add a simple dummy ssh test...
r1110 cd ..
cat dummylog