Patchwork D2040: py3: use .startswith() instead of bytes[0]

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

Comments

phabricator - Feb. 5, 2018, 8:22 a.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/revset.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -1841,7 +1841,7 @@ 
     keyflags = []
     for k in keys.split():
         fk = k
-        reverse = (k[0] == '-')
+        reverse = (k.startswith('-'))
         if reverse:
             k = k[1:]
         if k not in _sortkeyfuncs and k != 'topo':