errors: introduce InputError and use it from commands and cmdutil
This patch introduces a `InputError` class and replaces many uses of `error.Abort` by it in `commands` and `cmdutil`. This is a part of https://www.mercurial-scm.org/wiki/ErrorCategoriesPlan. There will later be a different class for state errors (to raise e.g. when there's an unfinished operation). It's not always clear when one should report an input error and when it should be a state error. We can always adjust later if I got something wrong in this patch (but feel free to point out any you notice now). Differential Revision: https://phab.mercurial-scm.org/D9167
Showing
- mercurial/cmdutil.py 47 additions, 35 deletionsmercurial/cmdutil.py
- mercurial/commands.py 117 additions, 89 deletionsmercurial/commands.py
- mercurial/error.py 7 additions, 0 deletionsmercurial/error.py
- mercurial/scmutil.py 2 additions, 0 deletionsmercurial/scmutil.py
- tests/test-add.t 1 addition, 1 deletiontests/test-add.t
- tests/test-amend.t 3 additions, 3 deletionstests/test-amend.t
- tests/test-archive.t 1 addition, 1 deletiontests/test-archive.t
- tests/test-backout.t 8 additions, 8 deletionstests/test-backout.t
- tests/test-bisect.t 15 additions, 15 deletionstests/test-bisect.t
- tests/test-bookmarks-pushpull.t 3 additions, 3 deletionstests/test-bookmarks-pushpull.t
- tests/test-bookmarks.t 11 additions, 11 deletionstests/test-bookmarks.t
- tests/test-branch-change.t 6 additions, 6 deletionstests/test-branch-change.t
- tests/test-branches.t 5 additions, 5 deletionstests/test-branches.t
- tests/test-bundle-r.t 2 additions, 2 deletionstests/test-bundle-r.t
- tests/test-bundle-type.t 4 additions, 4 deletionstests/test-bundle-type.t
- tests/test-bundle.t 3 additions, 3 deletionstests/test-bundle.t
- tests/test-clone-update-order.t 1 addition, 1 deletiontests/test-clone-update-order.t
- tests/test-clone.t 1 addition, 1 deletiontests/test-clone.t
- tests/test-commandserver.t 1 addition, 1 deletiontests/test-commandserver.t
- tests/test-commit-amend.t 4 additions, 4 deletionstests/test-commit-amend.t
Loading
Please register or sign in to comment