Mercurial > public > mercurial-scm > hg
diff hgext/keyword.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 | b3188339a772 |
children | 16cfbbc69800 |
line wrap: on
line diff
--- a/hgext/keyword.py Mon Oct 05 22:49:24 2015 -0700 +++ b/hgext/keyword.py Thu Oct 08 12:55:45 2015 -0700 @@ -83,7 +83,7 @@ ''' from mercurial import commands, context, cmdutil, dispatch, filelog, extensions -from mercurial import localrepo, match, patch, templatefilters, util +from mercurial import localrepo, match, patch, templatefilters, util, error from mercurial import scmutil, pathutil from mercurial.hgweb import webcommands from mercurial.i18n import _ @@ -348,20 +348,20 @@ return repo.status(match=scmutil.match(wctx, pats, opts), clean=True, unknown=opts.get('unknown') or opts.get('all')) if ui.configitems('keyword'): - raise util.Abort(_('[keyword] patterns cannot match')) - raise util.Abort(_('no [keyword] patterns configured')) + raise error.Abort(_('[keyword] patterns cannot match')) + raise error.Abort(_('no [keyword] patterns configured')) def _kwfwrite(ui, repo, expand, *pats, **opts): '''Selects files and passes them to kwtemplater.overwrite.''' wctx = repo[None] if len(wctx.parents()) > 1: - raise util.Abort(_('outstanding uncommitted merge')) + raise error.Abort(_('outstanding uncommitted merge')) kwt = kwtools['templater'] wlock = repo.wlock() try: status = _status(ui, repo, wctx, kwt, *pats, **opts) if status.modified or status.added or status.removed or status.deleted: - raise util.Abort(_('outstanding uncommitted changes')) + raise error.Abort(_('outstanding uncommitted changes')) kwt.overwrite(wctx, status.clean, True, expand) finally: wlock.release()