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

login
register
mail settings
Submitter phabricator
Date Feb. 21, 2018, 8:40 p.m.
Message ID <761a2e19870a0bca069548661ffe42f0@localhost.localdomain>
Download mbox | patch
Permalink /patch/28208/
State Not Applicable
Headers show

Comments

phabricator - Feb. 21, 2018, 8:40 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG06464d1ce6cd: convert: don&#039;t reimplement any() (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2373?vs=5953&id=5959

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

AFFECTED FILES
  hgext/convert/hg.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers, durin42
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: