Patchwork D2372: verify: don't reimplement any()

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

AFFECTED FILES
  mercurial/verify.py

CHANGE DETAILS




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

Patch

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])