# HG changeset patch # User Jesse Glick # Date 1203951357 18000 # Node ID be76e54570f0759a0c1333eff873c2d36b0e5fb4 # Parent 3a775af0bc9febff05c970bb819c5168b643b055 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. diff -r 3a775af0bc9f -r be76e54570f0 mercurial/hgweb/protocol.py --- a/mercurial/hgweb/protocol.py Fri Mar 14 20:01:50 2008 -0300 +++ b/mercurial/hgweb/protocol.py Mon Feb 25 09:55:57 2008 -0500 @@ -175,8 +175,8 @@ # send addchangegroup output to client - old_stdout = sys.stdout - sys.stdout = cStringIO.StringIO() + oldio = sys.stdout, sys.stderr + sys.stderr = sys.stdout = cStringIO.StringIO() try: url = 'remote:%s:%s' % (proto, @@ -188,7 +188,7 @@ ret = 0 finally: val = sys.stdout.getvalue() - sys.stdout = old_stdout + sys.stdout, sys.stderr = oldio req.write('%d\n' % ret) req.write(val) finally: