marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10821

AFFECTED FILES
  mercurial/verify.py

CHANGE DETAILS

diff --git a/mercurial/verify.py b/mercurial/verify.py
--- a/mercurial/verify.py
+++ b/mercurial/verify.py
@@ -50,6 +50,10 @@
     b"warning: copy source of '%s' not in parents of %s"
 )
 
+WARN_NULLID_COPY_SOURCE = _(
+    b"warning: %s@%s: copy source revision is nullid %s:%s\n"
+)
+
 
 class verifier(object):
     def __init__(self, repo, level=None):
@@ -557,13 +561,9 @@
                             m = _(b"empty or missing copy source revlog %s:%s")
                             self._err(lr, m % (rp[0], short(rp[1])), f)
                         elif rp[1] == self.repo.nullid:
-                            ui.note(
-                                _(
-                                    b"warning: %s@%s: copy source"
-                                    b" revision is nullid %s:%s\n"
-                                )
-                                % (f, lr, rp[0], short(rp[1]))
-                            )
+                            msg = WARN_NULLID_COPY_SOURCE
+                            msg %= (f, lr, rp[0], short(rp[1]))
+                            ui.note(msg)
                         else:
                             fl2.rev(rp[1])
                 except Exception as inst:



To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to