[Updated] D11382: dirstate: clarify the message in nonnormal checking

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Thu Sep 9 09:13:14 UTC 2021


Closed by commit rHGfea24454f919: dirstate: clarify the message in nonnormal checking (authored by marmoute).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D11382?vs=30172&id=30188

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D11382/new/

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

AFFECTED FILES
  contrib/dirstatenonnormalcheck.py

CHANGE DETAILS

diff --git a/contrib/dirstatenonnormalcheck.py b/contrib/dirstatenonnormalcheck.py
--- a/contrib/dirstatenonnormalcheck.py
+++ b/contrib/dirstatenonnormalcheck.py
@@ -24,17 +24,27 @@
     return res
 
 
+INCONSISTENCY_MESSAGE = b"""%s call to %s
+  inconsistency in nonnormalset
+  result from dirstatemap: %s
+  expected nonnormalset:   %s
+"""
+
+
 def checkconsistency(ui, orig, dmap, _nonnormalset, label):
     """Compute nonnormalset from dmap, check that it matches _nonnormalset"""
     nonnormalcomputedmap = nonnormalentries(dmap)
     if _nonnormalset != nonnormalcomputedmap:
         b_orig = pycompat.sysbytes(repr(orig))
-        ui.develwarn(b"%s call to %s\n" % (label, b_orig), config=b'dirstate')
-        ui.develwarn(b"inconsistency in nonnormalset\n", config=b'dirstate')
         b_nonnormal = pycompat.sysbytes(repr(_nonnormalset))
-        ui.develwarn(b"[nonnormalset] %s\n" % b_nonnormal, config=b'dirstate')
         b_nonnormalcomputed = pycompat.sysbytes(repr(nonnormalcomputedmap))
-        ui.develwarn(b"[map] %s\n" % b_nonnormalcomputed, config=b'dirstate')
+        msg = INCONSISTENCY_MESSAGE % (
+            label,
+            b_orig,
+            b_nonnormal,
+            b_nonnormalcomputed,
+        )
+        ui.develwarn(msg, config=b'dirstate')
 
 
 def _checkdirstate(orig, self, *args, **kwargs):



To: marmoute, #hg-reviewers, Alphare, pulkit
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210909/cce7f5f5/attachment-0002.html>


More information about the Mercurial-patches mailing list