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

login
register
mail settings
Submitter phabricator
Date Feb. 18, 2018, 8:54 p.m.
Message ID <differential-rev-PHID-DREV-5lhq3oilohitnnwh2twj-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28128/
State Superseded
Headers show

Comments

phabricator - Feb. 18, 2018, 8:54 p.m.
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




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

Patch

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()