diff mercurial/logcmdutil.py @ 48118:5105a9975407

errors: raise InputError from revsingle() iff revset provided by the user Same reasoning as for `revrange()` in an earlier patch. Differential Revision: https://phab.mercurial-scm.org/D11562
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 28 Sep 2021 15:11:22 -0700
parents b74e128676d4
children 91017508a785
line wrap: on
line diff
--- a/mercurial/logcmdutil.py	Tue Sep 28 13:59:01 2021 -0700
+++ b/mercurial/logcmdutil.py	Tue Sep 28 15:11:22 2021 -0700
@@ -912,6 +912,18 @@
     return None
 
 
+def revsingle(repo, revspec, default=b'.', localalias=None):
+    """Resolves user-provided revset(s) into a single revision.
+
+    This just wraps the lower-level scmutil.revsingle() in order to raise an
+    exception indicating user error.
+    """
+    try:
+        return scmutil.revsingle(repo, revspec, default, localalias)
+    except error.RepoLookupError as e:
+        raise error.InputError(e.args[0], hint=e.hint)
+
+
 def revpair(repo, revs):
     """Resolves user-provided revset(s) into two revisions.