diff mercurial/scmutil.py @ 48030:7d908ee19b5b

errors: use InputError for some invalid revsets and such Differential Revision: https://phab.mercurial-scm.org/D11496
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 23 Sep 2021 09:38:45 -0700
parents b66ae4468c9a
children 5b89626c11e9
line wrap: on
line diff
--- a/mercurial/scmutil.py	Thu Sep 23 17:05:37 2021 -0400
+++ b/mercurial/scmutil.py	Thu Sep 23 09:38:45 2021 -0700
@@ -689,7 +689,7 @@
 
     l = revrange(repo, [revspec], localalias=localalias)
     if not l:
-        raise error.Abort(_(b'empty revision set'))
+        raise error.InputError(_(b'empty revision set'))
     return repo[l.last()]
 
 
@@ -710,7 +710,7 @@
     l = revrange(repo, revs)
 
     if not l:
-        raise error.Abort(_(b'empty revision range'))
+        raise error.InputError(_(b'empty revision range'))
 
     first = l.first()
     second = l.last()
@@ -720,7 +720,7 @@
         and len(revs) >= 2
         and not all(revrange(repo, [r]) for r in revs)
     ):
-        raise error.Abort(_(b'empty revision on one side of range'))
+        raise error.InputError(_(b'empty revision on one side of range'))
 
     # if top-level is range expression, the result must always be a pair
     if first == second and len(revs) == 1 and not _pairspec(revs[0]):