changeset 47367:34a92e84267e

verify: use some intermediate variables instead of a multi-liner This is shorter and easier to read as the indentation remains the same. We extract the long message in a module level constant for clarity. Differential Revision: https://phab.mercurial-scm.org/D10819
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 01 Jun 2021 09:13:33 +0200
parents 15f6887c9c68
children 1a0f177b300a
files mercurial/verify.py
diffstat 1 files changed, 5 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/verify.py	Tue Jun 01 09:11:54 2021 +0200
+++ b/mercurial/verify.py	Tue Jun 01 09:13:33 2021 +0200
@@ -46,6 +46,10 @@
     b"parent-directory manifest refers to unknown revision %s"
 )
 
+WARN_UNKNOWN_COPY_SOURCE = _(
+    b"warning: copy source of '%s' not in parents of %s"
+)
+
 
 class verifier(object):
     def __init__(self, repo, level=None):
@@ -547,13 +551,7 @@
                         if lr is not None and ui.verbose:
                             ctx = lrugetctx(lr)
                             if not any(rp[0] in pctx for pctx in ctx.parents()):
-                                self._warn(
-                                    _(
-                                        b"warning: copy source of '%s' not"
-                                        b" in parents of %s"
-                                    )
-                                    % (f, ctx)
-                                )
+                                self._warn(WARN_UNKNOWN_COPY_SOURCE % (f, ctx))
                         fl2 = repo.file(rp[0])
                         if not len(fl2):
                             self._err(