httppeer: avoid large dumps when we don't see an hgweb repo
authorMatt Mackall <mpm@selenic.com>
Sun, 17 Feb 2013 14:41:31 -0600
changeset 18696 d23f61b6617f
parent 18695 ec9b9968b7f8
child 18697 4921b5c2aeed
httppeer: avoid large dumps when we don't see an hgweb repo When we don't get an hgweb protocol response, we dump the response to the user for diagnostic purposes (it might be a cgitb message, for instance). But if we try to clone a bundle, we don't want to show the entire bundle in the error message. Also, we don't want fetch the full bundle multiple times during fallback. So we only fetch 1k here.
mercurial/httppeer.py
--- a/mercurial/httppeer.py	Fri Feb 15 15:06:43 2013 -0600
+++ b/mercurial/httppeer.py	Sun Feb 17 14:41:31 2013 -0600
@@ -151,7 +151,7 @@
             raise error.RepoError(
                 _("'%s' does not appear to be an hg repository:\n"
                   "---%%<--- (%s)\n%s\n---%%<---\n")
-                % (safeurl, proto or 'no content-type', resp.read()))
+                % (safeurl, proto or 'no content-type', resp.read(1024)))
 
         if proto.startswith('application/mercurial-'):
             try: