Patchwork D2373: convert: don't reimplement any()

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

AFFECTED FILES
  hgext/convert/hg.py

CHANGE DETAILS




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

Patch

diff --git a/hgext/convert/hg.py b/hgext/convert/hg.py
--- a/hgext/convert/hg.py
+++ b/hgext/convert/hg.py
@@ -563,12 +563,7 @@ 
                 if copysource in self.ignored:
                     continue
                 # Ignore copy sources not in parent revisions
-                found = False
-                for p in parents:
-                    if copysource in p:
-                        found = True
-                        break
-                if not found:
+                if not any(copysource in p for p in parents):
                     continue
                 copies[name] = copysource
             except TypeError: