Patchwork D2374: strip: don't reimplement any()

login
register
mail settings
Submitter phabricator
Date Feb. 21, 2018, 6:45 p.m.
Message ID <differential-rev-PHID-DREV-g57xg6b56ylhqnp5csnm-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28201/
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/D2374

AFFECTED FILES
  hgext/strip.py

CHANGE DETAILS




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

Patch

diff --git a/hgext/strip.py b/hgext/strip.py
--- a/hgext/strip.py
+++ b/hgext/strip.py
@@ -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)