changeset 47363:9823b3489e90

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/D10815
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 01 Jun 2021 09:09:01 +0200
parents fb43853975b4
children 80c690bf4953
files mercurial/verify.py
diffstat 1 files changed, 5 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/verify.py	Tue Jun 01 09:06:33 2021 +0200
+++ b/mercurial/verify.py	Tue Jun 01 09:09:01 2021 +0200
@@ -42,6 +42,10 @@
     b'hint: run "hg debugrebuildfncache" to recover from corrupt fncache\n'
 )
 
+WARN_PARENT_DIR_UNKNOWN_REV = _(
+    b"parent-directory manifest refers to unknown revision %s"
+)
+
 
 class verifier(object):
     def __init__(self, repo, level=None):
@@ -372,15 +376,7 @@
             changesetpairs = [(c, m) for m in mflinkrevs for c in mflinkrevs[m]]
             for c, m in sorted(changesetpairs):
                 if dir:
-                    self._err(
-                        c,
-                        _(
-                            b"parent-directory manifest refers to unknown"
-                            b" revision %s"
-                        )
-                        % short(m),
-                        label,
-                    )
+                    self._err(c, WARN_PARENT_DIR_UNKNOWN_REV % short(m), label)
                 else:
                     self._err(
                         c,