D3926: scmutil: fix shortesthexnodeidprefix on Python 3 for 0-prefixed nodes

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Wed Jul 11 17:56:35 UTC 2018


durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This fixes test-bookmarks.t on Python 3 (which had regressed.)

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3926

AFFECTED FILES
  mercurial/scmutil.py

CHANGE DETAILS

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -458,7 +458,7 @@
             # 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] == '0' or i > len(cl):
+            if prefix[0:1] == b'0' or i > len(cl):
                 return False
             return True
         except ValueError:



To: durin42, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list