Patchwork D2376: 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-a4l2yrcgfsq3cdwizlus-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28204/
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/D2376

AFFECTED FILES
  hgext/mq.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel
phabricator - Feb. 21, 2018, 8:38 p.m.
durin42 accepted this revision.
durin42 added a comment.
This revision is now accepted and ready to land.


  congratulations on becoming the new mq maintainer!

REPOSITORY
  rHG Mercurial

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

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: