changeset 37520:fa6cdd6668e1

py3: use .startswith() instead of bytes[0] Differential Revision: https://phab.mercurial-scm.org/D3214
author Pulkit Goyal <7895pulkit@gmail.com>
date Tue, 10 Apr 2018 18:55:35 +0530
parents 3740d1abde44
children 2d00058ac2f8
files hgext/mq.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/mq.py	Tue Apr 10 20:14:12 2018 +0530
+++ b/hgext/mq.py	Tue Apr 10 18:55:35 2018 +0530
@@ -658,10 +658,11 @@
         if not patchguards:
             return True, None
         guards = self.active()
-        exactneg = [g for g in patchguards if g[0] == '-' and g[1:] in guards]
+        exactneg = [g for g in patchguards
+                    if g.startswith('-') and g[1:] in guards]
         if exactneg:
             return False, repr(exactneg[0])
-        pos = [g for g in patchguards if g[0] == '+']
+        pos = [g for g in patchguards if g.startswith('+')]
         exactpos = [g for g in pos if g[1:] in guards]
         if pos:
             if exactpos: