Mercurial > public > mercurial-scm > hg-stable
diff mercurial/match.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 | a5f62af29517 |
children | 1aee2ab0f902 |
line wrap: on
line diff
--- a/mercurial/match.py Mon Oct 05 22:49:24 2015 -0700 +++ b/mercurial/match.py Thu Oct 08 12:55:45 2015 -0700 @@ -13,6 +13,7 @@ from .i18n import _ from . import ( + error, pathutil, util, ) @@ -37,7 +38,7 @@ for kind, pat, source in kindpats: if kind == 'set': if not ctx: - raise util.Abort("fileset expression with no context") + raise error.Abort("fileset expression with no context") s = ctx.getfileset(pat) fset.update(s) @@ -290,7 +291,7 @@ files = files.splitlines() files = [f for f in files if f] except EnvironmentError: - raise util.Abort(_("unable to read file list (%s)") % pat) + raise error.Abort(_("unable to read file list (%s)") % pat) for k, p, source in self._normalize(files, default, root, cwd, auditor): kindpats.append((k, p, pat)) @@ -302,8 +303,8 @@ for k, p, source in self._normalize(includepats, default, root, cwd, auditor): kindpats.append((k, p, source or pat)) - except util.Abort as inst: - raise util.Abort('%s: %s' % (pat, inst[0])) + except error.Abort as inst: + raise error.Abort('%s: %s' % (pat, inst[0])) except IOError as inst: if self._warn: self._warn(_("skipping unreadable pattern file " @@ -587,11 +588,11 @@ _rematcher('(?:%s)' % _regex(k, p, globsuffix)) except re.error: if s: - raise util.Abort(_("%s: invalid pattern (%s): %s") % + raise error.Abort(_("%s: invalid pattern (%s): %s") % (s, k, p)) else: - raise util.Abort(_("invalid pattern (%s): %s") % (k, p)) - raise util.Abort(_("invalid pattern")) + raise error.Abort(_("invalid pattern (%s): %s") % (k, p)) + raise error.Abort(_("invalid pattern")) def _roots(kindpats): '''return roots and exact explicitly listed files from patterns