comparison mercurial/httppeer.py @ 18696:d23f61b6617f

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.
author Matt Mackall <mpm@selenic.com>
date Sun, 17 Feb 2013 14:41:31 -0600
parents 988974c2a4bf
children 4921b5c2aeed
comparison
equal deleted inserted replaced
18695:ec9b9968b7f8 18696:d23f61b6617f
149 proto.startswith('application/hg-changegroup')): 149 proto.startswith('application/hg-changegroup')):
150 self.ui.debug("requested URL: '%s'\n" % util.hidepassword(cu)) 150 self.ui.debug("requested URL: '%s'\n" % util.hidepassword(cu))
151 raise error.RepoError( 151 raise error.RepoError(
152 _("'%s' does not appear to be an hg repository:\n" 152 _("'%s' does not appear to be an hg repository:\n"
153 "---%%<--- (%s)\n%s\n---%%<---\n") 153 "---%%<--- (%s)\n%s\n---%%<---\n")
154 % (safeurl, proto or 'no content-type', resp.read())) 154 % (safeurl, proto or 'no content-type', resp.read(1024)))
155 155
156 if proto.startswith('application/mercurial-'): 156 if proto.startswith('application/mercurial-'):
157 try: 157 try:
158 version = proto.split('-', 1)[1] 158 version = proto.split('-', 1)[1]
159 version_info = tuple([int(n) for n in version.split('.')]) 159 version_info = tuple([int(n) for n in version.split('.')])