Mercurial > hg
diff hgext/largefiles/proto.py @ 26825:78539633acf3 stable
largefiles: don't mute and obfuscate http errors when putlfile fails
'unexpected putlfile response: None' when an http error occurs is not very
helpful.
Instead, leave the handling of urllib2.HTTPError exceptions to other layers.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Fri, 23 Oct 2015 21:27:29 +0200 |
parents | 56b2bcea2529 |
children | 33bd95443e7f |
line wrap: on
line diff
--- a/hgext/largefiles/proto.py Fri Oct 23 21:27:29 2015 +0200 +++ b/hgext/largefiles/proto.py Fri Oct 23 21:27:29 2015 +0200 @@ -86,15 +86,14 @@ # input file-like into a bundle before sending it, so we can't use # it ... if issubclass(self.__class__, httppeer.httppeer): - res = None + res = self._call('putlfile', data=fd, sha=sha, + headers={'content-type':'application/mercurial-0.1'}) try: - res = self._call('putlfile', data=fd, sha=sha, - headers={'content-type':'application/mercurial-0.1'}) d, output = res.split('\n', 1) for l in output.splitlines(True): self.ui.warn(_('remote: '), l) # assume l ends with \n return int(d) - except (ValueError, urllib2.HTTPError): + except ValueError: self.ui.warn(_('unexpected putlfile response: %r\n') % res) return 1 # ... but we can't use sshrepository._call because the data=