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

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Wed Apr 11 08:31:47 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGfa6cdd6668e1: py3: use .startswith() instead of bytes[0] (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3214?vs=7926&id=7966

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

AFFECTED FILES
  hgext/mq.py

CHANGE DETAILS

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -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:



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


More information about the Mercurial-devel mailing list