mercurial/scmutil.py
changeset 40341 d916ed3ca951
parent 40167 c554dc0cc16e
child 40367 824b687ff6af
--- a/mercurial/scmutil.py	Wed Oct 03 16:45:24 2018 +0300
+++ b/mercurial/scmutil.py	Tue Oct 16 07:21:00 2018 -0700
@@ -477,8 +477,9 @@
         i = int(prefix)
         # if we are a pure int, then starting with zero will not be
         # confused as a rev; or, obviously, if the int is larger
-        # than the value of the tip rev
-        if prefix[0:1] == b'0' or i >= len(repo):
+        # than the value of the tip rev. We still need to disambiguate if
+        # prefix == '0', since that *is* a valid revnum.
+        if (prefix != b'0' and prefix[0:1] == b'0') or i >= len(repo):
             return False
         return True
     except ValueError: