verify: format messages directly at the source
authorRaphaël Gomès <rgomes@octobus.net>
Wed, 21 Dec 2022 12:03:02 +0100
changeset 49824 fdd227585d5a
parent 49823 2715c8549f4b
child 49825 2f2682f40ea0
verify: format messages directly at the source
mercurial/debugcommands.py
mercurial/dirstate.py
--- a/mercurial/debugcommands.py	Mon May 02 11:58:43 2022 +0200
+++ b/mercurial/debugcommands.py	Wed Dec 21 12:03:02 2022 +0100
@@ -559,7 +559,7 @@
     m2 = repo[parent2].manifest()
     errors = 0
     for err in repo.dirstate.verify(m1, m2):
-        ui.warn(err[0] % err[1:])
+        ui.warn(err)
         errors += 1
     if errors:
         errstr = _(b".hg/dirstate inconsistent with current parent's manifest")
--- a/mercurial/dirstate.py	Mon May 02 11:58:43 2022 +0200
+++ b/mercurial/dirstate.py	Wed Dec 21 12:03:02 2022 +0100
@@ -1557,14 +1557,14 @@
         for f, entry in self.items():
             if entry.p1_tracked:
                 if entry.modified and f not in m1 and f not in m2:
-                    yield (missing_from_ps, f)
+                    yield missing_from_ps % f
                 elif f not in m1:
-                    yield (missing_from_p1, f)
+                    yield missing_from_p1 % f
             if entry.added and f in m1:
-                yield (unexpected_in_p1, f)
+                yield unexpected_in_p1 % f
         for f in m1:
             if narrow_matcher is not None and not narrow_matcher(f):
                 continue
             entry = self.get_entry(f)
             if not entry.p1_tracked:
-                yield (missing_from_ds, f)
+                yield missing_from_ds % f