changeset 36339:a4d41ba4ad23

verify: don't reimplement any() Differential Revision: https://phab.mercurial-scm.org/D2372
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 06 Feb 2018 08:49:37 -0800
parents ddd9474d2e08
children 06464d1ce6cd
files mercurial/verify.py
diffstat 1 files changed, 1 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/verify.py	Tue Feb 06 08:48:05 2018 -0800
+++ b/mercurial/verify.py	Tue Feb 06 08:49:37 2018 -0800
@@ -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])