Patchwork D2375: mq: don't reimplement any()

login
register
mail settings
Submitter phabricator
Date Feb. 21, 2018, 6:45 p.m.
Message ID <differential-rev-PHID-DREV-ryx6ianiar44jlvvzija-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28203/
State Superseded
Headers show

Comments

phabricator - Feb. 21, 2018, 6:45 p.m.
martinvonz 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/D2375

AFFECTED FILES
  hgext/mq.py

CHANGE DETAILS




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

Patch

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -553,10 +553,8 @@ 
             for patchfn in patches:
                 patchf = self.opener(patchfn, 'r')
                 # if the patch was a git patch, refresh it as a git patch
-                for line in patchf:
-                    if line.startswith('diff --git'):
-                        diffopts.git = True
-                        break
+                diffopts.git = any(line.startswith('diff --git')
+                                   for line in patchf)
                 patchf.close()
         return diffopts