D2374: strip: don't reimplement any()

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Wed Feb 21 15:40:12 EST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG28a97cf212af: strip: don't reimplement any() (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2374?vs=5954&id=5960

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

AFFECTED FILES
  hgext/strip.py

CHANGE DETAILS

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)
 



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


More information about the Mercurial-devel mailing list