diff mercurial/dirstate.py @ 49827:d09a57ce6fc4

verify: print short `p1` node in relevant dirstate messages This will help with debugging.
author Raphaël Gomès <rgomes@octobus.net>
date Wed, 21 Dec 2022 12:26:00 +0100
parents fdd227585d5a
children 96e526fe5fb0
line wrap: on
line diff
--- a/mercurial/dirstate.py	Mon May 02 11:27:20 2022 +0200
+++ b/mercurial/dirstate.py	Wed Dec 21 12:26:00 2022 +0100
@@ -1540,26 +1540,26 @@
         if data_backup is not None:
             o.unlink(data_backup[0])
 
-    def verify(self, m1, m2, narrow_matcher=None):
+    def verify(self, m1, m2, p1, narrow_matcher=None):
         """
         check the dirstate contents against the parent manifest and yield errors
         """
         missing_from_p1 = _(
-            b"%s marked as tracked in p1 but not in manifest1\n"
+            b"%s marked as tracked in p1 (%s) but not in manifest1\n"
         )
         unexpected_in_p1 = _(b"%s marked as added, but also in manifest1\n")
         missing_from_ps = _(
             b"%s marked as modified, but not in either manifest\n"
         )
         missing_from_ds = _(
-            b"%s in manifest1, but not marked as tracked in p1\n"
+            b"%s in manifest1, but not marked as tracked in p1 (%s)\n"
         )
         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
                 elif f not in m1:
-                    yield missing_from_p1 % f
+                    yield missing_from_p1 % (f, node.short(p1))
             if entry.added and f in m1:
                 yield unexpected_in_p1 % f
         for f in m1:
@@ -1567,4 +1567,4 @@
                 continue
             entry = self.get_entry(f)
             if not entry.p1_tracked:
-                yield missing_from_ds % f
+                yield missing_from_ds % (f, node.short(p1))