D2341: scmutil: fix requires-file isalnum() check on first byte

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Sun Feb 18 15:54:20 EST 2018


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

REVISION SUMMARY
  Slice instead of subscript to get a bytes from a bytes.
  
  1. skip-blame just a py3 slice-instead-of-subscript change

REPOSITORY
  rHG Mercurial

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

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
@@ -887,7 +887,7 @@
     missings = []
     for r in requirements:
         if r not in supported:
-            if not r or not r[0].isalnum():
+            if not r or not r[0:1].isalnum():
                 raise error.RequirementError(_(".hg/requires file is corrupt"))
             missings.append(r)
     missings.sort()



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


More information about the Mercurial-devel mailing list