# HG changeset patch # User Matt Mackall # Date 2013-02-17 20:41:31 # Node ID b376e8f91c16c949ff37e402e9020e77d76bad15 # Parent 56f8522c35915ed0a0e809ce97cee94dc9df5a48 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. diff --git a/mercurial/httppeer.py b/mercurial/httppeer.py --- a/mercurial/httppeer.py +++ b/mercurial/httppeer.py @@ -152,7 +152,7 @@ class httppeer(wireproto.wirepeer): 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: