D2373: convert: don't reimplement any()

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


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG06464d1ce6cd: convert: don'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

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:



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


More information about the Mercurial-devel mailing list