comparison tests/test-obsolete.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 fca9c63f160e
children f8f2ecdde4b5
comparison
equal deleted inserted replaced
48115:b067d22dc6ad 48116:5ced12cfa41b
201 201
202 $ hg tip 202 $ hg tip
203 5:5601fb93a350 (draft) [tip ] add new_3_c 203 5:5601fb93a350 (draft) [tip ] add new_3_c
204 $ hg log -r 6 204 $ hg log -r 6
205 abort: unknown revision '6' 205 abort: unknown revision '6'
206 [255] 206 [10]
207 $ hg log -r 4 207 $ hg log -r 4
208 abort: hidden revision '4' was rewritten as: 5601fb93a350 208 abort: hidden revision '4' was rewritten as: 5601fb93a350
209 (use --hidden to access hidden revisions) 209 (use --hidden to access hidden revisions)
210 [255] 210 [10]
211 $ hg debugrevspec 'rev(6)' 211 $ hg debugrevspec 'rev(6)'
212 $ hg debugrevspec 'rev(4)' 212 $ hg debugrevspec 'rev(4)'
213 $ hg debugrevspec 'null' 213 $ hg debugrevspec 'null'
214 -1 214 -1
215 215
1542 4:13bedc178fce (draft *obsolete*) [ bookb] add b [rewritten using amend as 5:a9b1f8652753] 1542 4:13bedc178fce (draft *obsolete*) [ bookb] add b [rewritten using amend as 5:a9b1f8652753]
1543 $ hg book -d bookb 1543 $ hg book -d bookb
1544 $ hg log -r 13bedc178fce 1544 $ hg log -r 13bedc178fce
1545 abort: hidden revision '13bedc178fce' was rewritten as: a9b1f8652753 1545 abort: hidden revision '13bedc178fce' was rewritten as: a9b1f8652753
1546 (use --hidden to access hidden revisions) 1546 (use --hidden to access hidden revisions)
1547 [255] 1547 [10]
1548 1548
1549 Empty out the test extension, as it isn't compatible with later parts 1549 Empty out the test extension, as it isn't compatible with later parts
1550 of the test. 1550 of the test.
1551 $ echo > $TESTTMP/test_extension.py 1551 $ echo > $TESTTMP/test_extension.py
1552 1552