changeset 36374:28a97cf212af

strip: don't reimplement any() Differential Revision: https://phab.mercurial-scm.org/D2374
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 06 Feb 2018 08:54:36 -0800
parents 06464d1ce6cd
children 02c35e640b3c
files hgext/strip.py
diffstat 1 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/strip.py	Tue Feb 06 08:52:12 2018 -0800
+++ b/hgext/strip.py	Tue Feb 06 08:54:36 2018 -0800
@@ -181,13 +181,10 @@
         strippedrevs = revs.union(descendants)
         roots = revs.difference(descendants)
 
-        update = False
         # if one of the wdir parent is stripped we'll need
         # to update away to an earlier revision
-        for p in repo.dirstate.parents():
-            if p != nullid and cl.rev(p) in strippedrevs:
-                update = True
-                break
+        update = any(p != nullid and cl.rev(p) in strippedrevs
+                     for p in repo.dirstate.parents())
 
         rootnodes = set(cl.node(r) for r in roots)