comparison mercurial/hg.py @ 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 1fdf315eff66
children 1d70fb83ff4a
comparison
equal deleted inserted replaced
48115:b067d22dc6ad 48116:5ced12cfa41b
1350 branches = path.branch, opts.get(b'branch') or [] 1350 branches = path.branch, opts.get(b'branch') or []
1351 1351
1352 ui.status(_(b'comparing with %s\n') % urlutil.hidepassword(dest)) 1352 ui.status(_(b'comparing with %s\n') % urlutil.hidepassword(dest))
1353 revs, checkout = addbranchrevs(repo, repo, branches, opts.get(b'rev')) 1353 revs, checkout = addbranchrevs(repo, repo, branches, opts.get(b'rev'))
1354 if revs: 1354 if revs:
1355 revs = [repo[rev].node() for rev in scmutil.revrange(repo, revs)] 1355 revs = [repo[rev].node() for rev in logcmdutil.revrange(repo, revs)]
1356 1356
1357 other = peer(repo, opts, dest) 1357 other = peer(repo, opts, dest)
1358 try: 1358 try:
1359 outgoing = discovery.findcommonoutgoing( 1359 outgoing = discovery.findcommonoutgoing(
1360 repo, other, revs, force=opts.get(b'force') 1360 repo, other, revs, force=opts.get(b'force')