Mercurial > hg
comparison tests/test-directaccess.t @ 48116:5ced12cfa41b
errors: raise InputError on bad revset to revrange() iff provided by the user
Most callers of `scmutil.revrange()` pass in a revset provided by the
user. If there are problems resolving that, it should result in an
`InputError` and exit code 10 (when using detailed exit
codes). However, there are also some callers that pass in revsets not
provided by the user. `InputError` is not appropriate in those
cases. This patch therefore introduces a wrapper around
`scmutil.revrange()` that simply converts the exception type. I put it
in `logcmdutil.py` since that seems to be the lowest-level module in
the (poorly defined) UI layer.
Differential Revision: https://phab.mercurial-scm.org/D11560
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 28 Sep 2021 08:47:11 -0700 |
parents | 95c4cca641f6 |
children | 5105a9975407 |
comparison
equal
deleted
inserted
replaced
48115:b067d22dc6ad | 48116:5ced12cfa41b |
---|---|
40 Testing with rev number | 40 Testing with rev number |
41 | 41 |
42 $ hg exp 2 --config experimental.directaccess.revnums=False | 42 $ hg exp 2 --config experimental.directaccess.revnums=False |
43 abort: hidden revision '2' was rewritten as: 2443a0e66469 | 43 abort: hidden revision '2' was rewritten as: 2443a0e66469 |
44 (use --hidden to access hidden revisions) | 44 (use --hidden to access hidden revisions) |
45 [255] | 45 [10] |
46 | 46 |
47 $ hg exp 2 | 47 $ hg exp 2 |
48 # HG changeset patch | 48 # HG changeset patch |
49 # User test | 49 # User test |
50 # Date 0 0 | 50 # Date 0 0 |
195 Commands with undefined intent should not work right now | 195 Commands with undefined intent should not work right now |
196 | 196 |
197 $ hg phase -r 28ad74 | 197 $ hg phase -r 28ad74 |
198 abort: hidden revision '28ad74' was rewritten as: 2443a0e66469 | 198 abort: hidden revision '28ad74' was rewritten as: 2443a0e66469 |
199 (use --hidden to access hidden revisions) | 199 (use --hidden to access hidden revisions) |
200 [255] | 200 [10] |
201 | 201 |
202 $ hg phase -r 2 | 202 $ hg phase -r 2 |
203 abort: hidden revision '2' was rewritten as: 2443a0e66469 | 203 abort: hidden revision '2' was rewritten as: 2443a0e66469 |
204 (use --hidden to access hidden revisions) | 204 (use --hidden to access hidden revisions) |
205 [255] | 205 [10] |
206 | 206 |
207 Setting a bookmark will make that changeset unhidden, so this should come in end | 207 Setting a bookmark will make that changeset unhidden, so this should come in end |
208 | 208 |
209 $ hg bookmarks -r 28ad74 book | 209 $ hg bookmarks -r 28ad74 book |
210 bookmarking hidden changeset 28ad74487de9 | 210 bookmarking hidden changeset 28ad74487de9 |