Mercurial > hg
diff hgext/largefiles/remotestore.py @ 26587:56b2bcea2529
error: get Abort from 'error' instead of 'util'
The home of 'Abort' is 'error' not 'util' however, a lot of code seems to be
confused about that and gives all the credit to 'util' instead of the
hardworking 'error'. In a spirit of equity, we break the cycle of injustice and
give back to 'error' the respect it deserves. And screw that 'util' poser.
For great justice.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 08 Oct 2015 12:55:45 -0700 |
parents | 328739ea70c3 |
children | 3be2e89c5d9f |
line wrap: on
line diff
--- a/hgext/largefiles/remotestore.py Mon Oct 05 22:49:24 2015 -0700 +++ b/hgext/largefiles/remotestore.py Thu Oct 08 12:55:45 2015 -0700 @@ -8,7 +8,7 @@ import urllib2 -from mercurial import util, wireproto +from mercurial import util, wireproto, error from mercurial.i18n import _ import lfutil @@ -21,7 +21,7 @@ def put(self, source, hash): if self.sendfile(source, hash): - raise util.Abort( + raise error.Abort( _('remotestore: could not put %s to remote store %s') % (source, util.hidepassword(self.url))) self.ui.debug( @@ -39,7 +39,7 @@ fd = lfutil.httpsendfile(self.ui, filename) return self._put(hash, fd) except IOError as e: - raise util.Abort( + raise error.Abort( _('remotestore: could not open file %s: %s') % (filename, str(e))) finally: @@ -50,14 +50,14 @@ try: chunks = self._get(hash) except urllib2.HTTPError as e: - # 401s get converted to util.Aborts; everything else is fine being + # 401s get converted to error.Aborts; everything else is fine being # turned into a StoreError raise basestore.StoreError(filename, hash, self.url, str(e)) except urllib2.URLError as e: # This usually indicates a connection problem, so don't # keep trying with the other files... they will probably # all fail too. - raise util.Abort('%s: %s' % + raise error.Abort('%s: %s' % (util.hidepassword(self.url), e.reason)) except IOError as e: raise basestore.StoreError(filename, hash, self.url, str(e))