mercurial/scmutil.py
changeset 37350 e32dfff71529
parent 37306 6942c73f0733
child 37360 d0d55980ffa7
--- 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).