diff mercurial/hgweb/common.py @ 9694:8269fe2d48f6

hgweb: send proper error messages to the client Fixes a bug in protocol which caused an exception during exception handling in some cases on Windows. Also makes sure the server error message is correctly propagated to the client, instead of being thrown away.
author Sune Foldager <cryo@cyanite.org>
date Mon, 02 Nov 2009 10:20:04 +0100
parents 3b76321aa0de
children 6f92997dbdca 25e572394f5c
line wrap: on
line diff
--- a/mercurial/hgweb/common.py	Mon Nov 02 10:19:14 2009 +0100
+++ b/mercurial/hgweb/common.py	Mon Nov 02 10:20:04 2009 +0100
@@ -31,8 +31,8 @@
     responses = BaseHTTPRequestHandler.responses
     return responses.get(code, ('Error', 'Unknown error'))[0]
 
-def statusmessage(code):
-    return '%d %s' % (code, _statusmessage(code))
+def statusmessage(code, message=None):
+    return '%d %s' % (code, message or _statusmessage(code))
 
 def get_mtime(repo_path):
     store_path = os.path.join(repo_path, ".hg")