Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/scmutil.py @ 38659:cc76692f401d
scmutil: fix shortesthexnodeidprefix on Python 3 for 0-prefixed nodes
This fixes test-bookmarks.t on Python 3 (which had regressed.)
Differential Revision: https://phab.mercurial-scm.org/D3926
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 11 Jul 2018 13:40:50 -0400 |
parents | 85c74c5a1590 |
children | 3b072388ca78 |
comparison
equal
deleted
inserted
replaced
38658:a75896bf5ccb | 38659:cc76692f401d |
---|---|
456 try: | 456 try: |
457 i = int(prefix) | 457 i = int(prefix) |
458 # if we are a pure int, then starting with zero will not be | 458 # if we are a pure int, then starting with zero will not be |
459 # confused as a rev; or, obviously, if the int is larger | 459 # confused as a rev; or, obviously, if the int is larger |
460 # than the value of the tip rev | 460 # than the value of the tip rev |
461 if prefix[0] == '0' or i > len(cl): | 461 if prefix[0:1] == b'0' or i > len(cl): |
462 return False | 462 return False |
463 return True | 463 return True |
464 except ValueError: | 464 except ValueError: |
465 return False | 465 return False |
466 | 466 |