Mercurial > public > mercurial-scm > hg
diff mercurial/patch.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 | 75d448d56a9d |
children | 1aee2ab0f902 |
line wrap: on
line diff
--- a/mercurial/patch.py Mon Oct 05 22:49:24 2015 -0700 +++ b/mercurial/patch.py Thu Oct 08 12:55:45 2015 -0700 @@ -1056,7 +1056,7 @@ elif r == 6: # all ret = skipall = True elif r == 7: # quit - raise util.Abort(_('user quit')) + raise error.Abort(_('user quit')) return ret, skipfile, skipall, newpatches seen = set() @@ -1964,7 +1964,7 @@ else: store.setfile(path, data, mode) else: - raise util.Abort(_('unsupported parser state: %s') % state) + raise error.Abort(_('unsupported parser state: %s') % state) if current_file: rejects += current_file.close() @@ -2022,7 +2022,7 @@ if eolmode is None: eolmode = ui.config('patch', 'eol', 'strict') if eolmode.lower() not in eolmodes: - raise util.Abort(_('unsupported line endings type: %s') % eolmode) + raise error.Abort(_('unsupported line endings type: %s') % eolmode) eolmode = eolmode.lower() store = filestore() @@ -2095,7 +2095,7 @@ if gp.op == 'RENAME': changed.add(gp.oldpath) elif state not in ('hunk', 'git'): - raise util.Abort(_('unsupported parser state: %s') % state) + raise error.Abort(_('unsupported parser state: %s') % state) return changed finally: fp.close()