comparison tests/test-branch-change.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 055f7b9f2307
children f8f2ecdde4b5
comparison
equal deleted inserted replaced
48115:b067d22dc6ad 48116:5ced12cfa41b
145 Changing branch of an obsoleted changeset 145 Changing branch of an obsoleted changeset
146 146
147 $ hg branch -r 4 foobar 147 $ hg branch -r 4 foobar
148 abort: hidden revision '4' was rewritten as: 7c1991464886 148 abort: hidden revision '4' was rewritten as: 7c1991464886
149 (use --hidden to access hidden revisions) 149 (use --hidden to access hidden revisions)
150 [255] 150 [10]
151 151
152 $ hg branch -r 4 --hidden foobar 152 $ hg branch -r 4 --hidden foobar
153 abort: cannot change branch of 3938acfb5c0f, as that creates content-divergence with 7c1991464886 153 abort: cannot change branch of 3938acfb5c0f, as that creates content-divergence with 7c1991464886
154 (add --verbose for details or see 'hg help evolution.instability') 154 (add --verbose for details or see 'hg help evolution.instability')
155 [10] 155 [10]