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

login
register
mail settings
Submitter phabricator
Date Feb. 21, 2018, 8:40 p.m.
Message ID <042f7c9f5365b267bc9d1263d0cf2468@localhost.localdomain>
Download mbox | patch
Permalink /patch/28210/
State Not Applicable
Headers show

Comments

phabricator - Feb. 21, 2018, 8:40 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGc8891cc3fa9e: mq: don&#039;t reimplement any() (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2376?vs=5956&id=5962

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

AFFECTED FILES
  hgext/mq.py

CHANGE DETAILS




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

Patch

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -1555,12 +1555,8 @@ 
                         update = True
             else:
                 parents = [p.node() for p in repo[None].parents()]
-                needupdate = False
-                for entry in self.applied[start:]:
-                    if entry.node in parents:
-                        needupdate = True
-                        break
-                update = needupdate
+                update = any(entry.node in parents
+                             for entry in self.applied[start:])
 
             tobackup = set()
             if update: