Mercurial > public > mercurial-scm > hg
diff mercurial/dirstate.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 | 3f41e28a16d8 |
children | 502b56a9e897 |
line wrap: on
line diff
--- a/mercurial/dirstate.py Mon Oct 05 22:49:24 2015 -0700 +++ b/mercurial/dirstate.py Thu Oct 08 12:55:45 2015 -0700 @@ -7,7 +7,7 @@ from node import nullid from i18n import _ -import scmutil, util, osutil, parsers, encoding, pathutil +import scmutil, util, osutil, parsers, encoding, pathutil, error import os, stat, errno import match as matchmod @@ -134,7 +134,7 @@ if l == 40: return st[:20], st[20:40] elif l > 0 and l < 40: - raise util.Abort(_('working directory state appears damaged!')) + raise error.Abort(_('working directory state appears damaged!')) except IOError as err: if err.errno != errno.ENOENT: raise @@ -412,13 +412,13 @@ if state == 'a' or oldstate == 'r': scmutil.checkfilename(f) if f in self._dirs: - raise util.Abort(_('directory %r already in dirstate') % f) + raise error.Abort(_('directory %r already in dirstate') % f) # shadows for d in util.finddirs(f): if d in self._dirs: break if d in self._map and self[d] != 'r': - raise util.Abort( + raise error.Abort( _('file %r in dirstate clashes with %r') % (d, f)) if oldstate in "?r" and "_dirs" in self.__dict__: self._dirs.addpath(f) @@ -464,7 +464,7 @@ def otherparent(self, f): '''Mark as coming from the other parent, always dirty.''' if self._pl[1] == nullid: - raise util.Abort(_("setting %r to other parent " + raise error.Abort(_("setting %r to other parent " "only allowed in merges") % f) if f in self and self[f] == 'n': # merge-like