# HG changeset patch # User Martin von Zweigbergk # Date 2018-02-06 16:55:54 # Node ID 02c35e640b3c2f7175cf3a7fe190471bbf1ebdb9 # Parent 28a97cf212afe4c4c48a5bf29618dbc7f8664f76 mq: don't reimplement any() Differential Revision: https://phab.mercurial-scm.org/D2375 diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -553,10 +553,8 @@ class queue(object): 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