diff tests/test-ssh @ 5978:7939c71f3132

sshrepo: be more careful while reading data This should avoid some tracebacks when the server sends some garbage.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Sun, 03 Feb 2008 21:03:46 -0200
parents 58517f6eb1ad
children 9f76df0edb7d
line wrap: on
line diff
--- a/tests/test-ssh	Sun Feb 03 21:03:46 2008 -0200
+++ b/tests/test-ssh	Sun Feb 03 21:03:46 2008 -0200
@@ -27,6 +27,11 @@
 sys.exit(bool(r))
 EOF
 
+cat <<EOF > badhook
+import sys
+sys.stdout.write("KABOOM")
+EOF
+
 echo "# creating 'remote'"
 hg init remote
 cd remote
@@ -91,13 +96,16 @@
 
 echo z > z
 hg ci -A -m z -d '1000001 0' z
+# a bad, evil hook that prints to stdout
+echo 'changegroup.stdout = python ../badhook' >> .hg/hgrc
 
 cd ../local
 echo r > r
 hg ci -A -m z -d '1000002 0' r
 
-echo "# push should succeed"
+echo "# push should succeed even though it has an unexpected response"
 hg push
+hg -R ../remote heads
 
 cd ..
 cat dummylog