D2375: mq: don't reimplement any()

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Wed Feb 21 15:40:39 EST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG02c35e640b3c: mq: don't reimplement any() (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2375?vs=5955&id=5961

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

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
@@ -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
 



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


More information about the Mercurial-devel mailing list