Mercurial > public > mercurial-scm > hg-stable
diff mercurial/ui.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 | c8f42c1926a5 |
children | 9f9ec4abe700 |
line wrap: on
line diff
--- a/mercurial/ui.py Mon Oct 05 22:49:24 2015 -0700 +++ b/mercurial/ui.py Thu Oct 08 12:55:45 2015 -0700 @@ -535,11 +535,12 @@ except KeyError: pass if not user: - raise util.Abort(_('no username supplied'), + raise error.Abort(_('no username supplied'), hint=_('use "hg config --edit" ' 'to set your username')) if "\n" in user: - raise util.Abort(_("username %s contains a newline\n") % repr(user)) + raise error.Abort(_("username %s contains a newline\n") + % repr(user)) return user def shortuser(self, user): @@ -755,7 +756,7 @@ self.write(r, "\n") return r except EOFError: - raise util.Abort(_('response expected')) + raise error.Abort(_('response expected')) @staticmethod def extractchoices(prompt): @@ -802,7 +803,7 @@ else: return getpass.getpass('') except EOFError: - raise util.Abort(_('response expected')) + raise error.Abort(_('response expected')) def status(self, *msg, **opts): '''write status message to output (if ui.quiet is False) @@ -858,7 +859,7 @@ self.system("%s \"%s\"" % (editor, name), environ=environ, - onerr=util.Abort, errprefix=_("edit failed")) + onerr=error.Abort, errprefix=_("edit failed")) f = open(name) t = f.read()