##// END OF EJS Templates
Avoid float rounding errors when checking http protocol version.
Thomas Arendsen Hein -
r4356:aed9e6dc default
parent child Browse files
Show More
@@ -280,11 +280,12 b' class httprepository(remoterepository):'
280
280
281 if proto.startswith('application/mercurial-'):
281 if proto.startswith('application/mercurial-'):
282 try:
282 try:
283 version = float(proto[22:])
283 version = proto.split('-', 1)[1]
284 version_info = tuple([int(n) for n in version.split('.')])
284 except ValueError:
285 except ValueError:
285 raise hg.RepoError(_("'%s' sent a broken Content-type "
286 raise hg.RepoError(_("'%s' sent a broken Content-type "
286 "header (%s)") % (self._url, proto))
287 "header (%s)") % (self._url, proto))
287 if version > 0.1:
288 if version_info > (0, 1):
288 raise hg.RepoError(_("'%s' uses newer protocol %s") %
289 raise hg.RepoError(_("'%s' uses newer protocol %s") %
289 (self._url, version))
290 (self._url, version))
290
291
General Comments 0
You need to be logged in to leave comments. Login now