Mercurial > public > mercurial-scm > hg
diff hgext/hgcia.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 | 80c5b2666a96 |
children |
line wrap: on
line diff
--- a/hgext/hgcia.py Mon Oct 05 22:49:24 2015 -0700 +++ b/hgext/hgcia.py Thu Oct 08 12:55:45 2015 -0700 @@ -43,7 +43,7 @@ from mercurial.i18n import _ from mercurial.node import bin, short -from mercurial import cmdutil, patch, util, mail +from mercurial import cmdutil, patch, util, mail, error import email.Parser import socket, xmlrpclib @@ -233,7 +233,7 @@ srv = xmlrpclib.Server(self.ciaurl) res = srv.hub.deliver(msg) if res is not True and res != 'queued.': - raise util.Abort(_('%s returned an error: %s') % + raise error.Abort(_('%s returned an error: %s') % (self.ciaurl, res)) def sendemail(self, address, data): @@ -259,7 +259,7 @@ ui.write(msg) elif cia.ciaurl.startswith('mailto:'): if not cia.emailfrom: - raise util.Abort(_('email.from must be defined when ' + raise error.Abort(_('email.from must be defined when ' 'sending by email')) cia.sendemail(cia.ciaurl[7:], msg) else: