revlog: use revlog.display_id in error related to bad revisions
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 03 May 2021 12:24:50 +0200
changeset 47163 6bc7c467a7d1
parent 47162 dfe8074239de
child 47164 04f2f94836a5
revlog: use revlog.display_id in error related to bad revisions Differential Revision: https://phab.mercurial-scm.org/D10589
mercurial/revlog.py
--- a/mercurial/revlog.py	Mon May 03 12:24:40 2021 +0200
+++ b/mercurial/revlog.py	Mon May 03 12:24:50 2021 +0200
@@ -2033,7 +2033,7 @@
         """
         if link == nullrev:
             raise error.RevlogError(
-                _(b"attempted to add linkrev -1 to %s") % self._indexfile
+                _(b"attempted to add linkrev -1 to %s") % self.display_id
             )
 
         if sidedata is None:
@@ -2229,14 +2229,14 @@
         """
         if node == self.nullid:
             raise error.RevlogError(
-                _(b"%s: attempt to add null revision") % self._indexfile
+                _(b"%s: attempt to add null revision") % self.display_id
             )
         if (
             node == self.nodeconstants.wdirid
             or node in self.nodeconstants.wdirfilenodeids
         ):
             raise error.RevlogError(
-                _(b"%s: attempt to add wdir revision") % self._indexfile
+                _(b"%s: attempt to add wdir revision") % self.display_id
             )
 
         if self._inline: