diff -r 36b2a304216c -r e32dfff71529 mercurial/scmutil.py --- a/mercurial/scmutil.py Tue Apr 03 15:08:14 2018 -0700 +++ b/mercurial/scmutil.py Sun Apr 01 22:48:32 2018 -0700 @@ -433,6 +433,13 @@ hexfunc = short return '%d:%s' % (rev, hexfunc(node)) +def isrevsymbol(repo, symbol): + try: + revsymbol(repo, symbol) + return True + except error.RepoLookupError: + return False + def revsymbol(repo, symbol): """Returns a context given a single revision symbol (as string).