Mercurial > hg
comparison hgext/purge.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 | 4b0fc75f9403 |
children | 27996f78a64c |
comparison
equal
deleted
inserted
replaced
26586:d51c658d3f04 | 26587:56b2bcea2529 |
---|---|
22 # You should have received a copy of the GNU General Public License | 22 # You should have received a copy of the GNU General Public License |
23 # along with this program; if not, see <http://www.gnu.org/licenses/>. | 23 # along with this program; if not, see <http://www.gnu.org/licenses/>. |
24 | 24 |
25 '''command to delete untracked files from the working directory''' | 25 '''command to delete untracked files from the working directory''' |
26 | 26 |
27 from mercurial import util, commands, cmdutil, scmutil | 27 from mercurial import util, commands, cmdutil, scmutil, error |
28 from mercurial.i18n import _ | 28 from mercurial.i18n import _ |
29 import os | 29 import os |
30 | 30 |
31 cmdtable = {} | 31 cmdtable = {} |
32 command = cmdutil.command(cmdtable) | 32 command = cmdutil.command(cmdtable) |
92 try: | 92 try: |
93 remove_func(repo.wjoin(name)) | 93 remove_func(repo.wjoin(name)) |
94 except OSError: | 94 except OSError: |
95 m = _('%s cannot be removed') % name | 95 m = _('%s cannot be removed') % name |
96 if opts['abort_on_err']: | 96 if opts['abort_on_err']: |
97 raise util.Abort(m) | 97 raise error.Abort(m) |
98 ui.warn(_('warning: %s\n') % m) | 98 ui.warn(_('warning: %s\n') % m) |
99 else: | 99 else: |
100 ui.write('%s%s' % (name, eol)) | 100 ui.write('%s%s' % (name, eol)) |
101 | 101 |
102 match = scmutil.match(repo[None], dirs, opts) | 102 match = scmutil.match(repo[None], dirs, opts) |