diff -r 2d45b549392f -r d916ed3ca951 mercurial/scmutil.py --- 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: