D2376: 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 rHGc8891cc3fa9e: mq: don'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

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:



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


More information about the Mercurial-devel mailing list