From patchwork Wed Feb 21 20:40:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D2372: verify: don't reimplement any() From: phabricator X-Patchwork-Id: 28205 Message-Id: <8e4ab80279db57e1a7a5f5e43e0a155f@localhost.localdomain> To: mercurial-devel@mercurial-scm.org Date: Wed, 21 Feb 2018 20:40:05 +0000 This revision was automatically updated to reflect the committed changes. Closed by commit rHGa4d41ba4ad23: verify: don't reimplement any() (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2372?vs=5952&id=5958 REVISION DETAIL https://phab.mercurial-scm.org/D2372 AFFECTED FILES mercurial/verify.py CHANGE DETAILS To: martinvonz, #hg-reviewers, durin42 Cc: mercurial-devel diff --git a/mercurial/verify.py b/mercurial/verify.py --- a/mercurial/verify.py +++ b/mercurial/verify.py @@ -456,12 +456,7 @@ if rp: if lr is not None and ui.verbose: ctx = lrugetctx(lr) - found = False - for pctx in ctx.parents(): - if rp[0] in pctx: - found = True - break - if not found: + if not any(rp[0] in pctx for pctx in ctx.parents()): self.warn(_("warning: copy source of '%s' not" " in parents of %s") % (f, ctx)) fl2 = repo.file(rp[0])