comparison 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
comparison
equal deleted inserted replaced
48117:b74e128676d4 48118:5105a9975407
910 def _makenofollowfilematcher(repo, pats, opts): 910 def _makenofollowfilematcher(repo, pats, opts):
911 '''hook for extensions to override the filematcher for non-follow cases''' 911 '''hook for extensions to override the filematcher for non-follow cases'''
912 return None 912 return None
913 913
914 914
915 def revsingle(repo, revspec, default=b'.', localalias=None):
916 """Resolves user-provided revset(s) into a single revision.
917
918 This just wraps the lower-level scmutil.revsingle() in order to raise an
919 exception indicating user error.
920 """
921 try:
922 return scmutil.revsingle(repo, revspec, default, localalias)
923 except error.RepoLookupError as e:
924 raise error.InputError(e.args[0], hint=e.hint)
925
926
915 def revpair(repo, revs): 927 def revpair(repo, revs):
916 """Resolves user-provided revset(s) into two revisions. 928 """Resolves user-provided revset(s) into two revisions.
917 929
918 This just wraps the lower-level scmutil.revpair() in order to raise an 930 This just wraps the lower-level scmutil.revpair() in order to raise an
919 exception indicating user error. 931 exception indicating user error.