comparison tests/test-log-linerange.t @ 45827:8d72e29ad1e0

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
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 06 Oct 2020 22:36:15 -0700
parents 29adf0a087a1
children fc4fb2f17dd4
comparison
equal deleted inserted replaced
45826:21733e8c924f 45827:8d72e29ad1e0
361 361
362 Regular file patterns are not allowed. 362 Regular file patterns are not allowed.
363 363
364 $ hg log -f -L foo,5:7 -p bar 364 $ hg log -f -L foo,5:7 -p bar
365 abort: FILE arguments are not compatible with --line-range option 365 abort: FILE arguments are not compatible with --line-range option
366 [255] 366 [10]
367 367
368 Option --rev acts as a restriction. 368 Option --rev acts as a restriction.
369 369
370 $ hg log -f -L foo,5:7 -p -r 'desc(2)' 370 $ hg log -f -L foo,5:7 -p -r 'desc(2)'
371 changeset: 2:63a884426fd0 371 changeset: 2:63a884426fd0
1133 1133
1134 Option --follow is required. 1134 Option --follow is required.
1135 1135
1136 $ hg log -L foo,5:7 1136 $ hg log -L foo,5:7
1137 abort: --line-range requires --follow 1137 abort: --line-range requires --follow
1138 [255] 1138 [10]
1139 1139
1140 Non-exact pattern kinds are not allowed. 1140 Non-exact pattern kinds are not allowed.
1141 1141
1142 $ cd .. 1142 $ cd ..
1143 $ hg log -f -L glob:*a*,1:2 1143 $ hg log -f -L glob:*a*,1:2