comparison tests/test-bookmarks.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 28a914b3d4ce
children 8c4881c07f57
comparison
equal deleted inserted replaced
48115:b067d22dc6ad 48116:5ced12cfa41b
183 183
184 but "literal:." is not since "." seems not a literal bookmark: 184 but "literal:." is not since "." seems not a literal bookmark:
185 185
186 $ hg log -r 'bookmark("literal:.")' 186 $ hg log -r 'bookmark("literal:.")'
187 abort: bookmark '.' does not exist 187 abort: bookmark '.' does not exist
188 [255] 188 [10]
189 189
190 "." should fail if there's no active bookmark: 190 "." should fail if there's no active bookmark:
191 191
192 $ hg bookmark --inactive 192 $ hg bookmark --inactive
193 $ hg log -r 'bookmark(.)' 193 $ hg log -r 'bookmark(.)'
194 abort: no active bookmark 194 abort: no active bookmark
195 [255] 195 [10]
196 $ hg log -r 'present(bookmark(.))' 196 $ hg log -r 'present(bookmark(.))'
197 197
198 $ hg log -r 'bookmark(unknown)' 198 $ hg log -r 'bookmark(unknown)'
199 abort: bookmark 'unknown' does not exist 199 abort: bookmark 'unknown' does not exist
200 [255] 200 [10]
201 $ hg log -r 'bookmark("literal:unknown")' 201 $ hg log -r 'bookmark("literal:unknown")'
202 abort: bookmark 'unknown' does not exist 202 abort: bookmark 'unknown' does not exist
203 [255] 203 [10]
204 $ hg log -r 'bookmark("re:unknown")' 204 $ hg log -r 'bookmark("re:unknown")'
205 $ hg log -r 'present(bookmark("literal:unknown"))' 205 $ hg log -r 'present(bookmark("literal:unknown"))'
206 $ hg log -r 'present(bookmark("re:unknown"))' 206 $ hg log -r 'present(bookmark("re:unknown"))'
207 207
208 $ hg help revsets | grep 'bookmark(' 208 $ hg help revsets | grep 'bookmark('