Patchwork D10589: revlog: use revlog.display_id in error related to bad revisions

login
register
mail settings
Submitter phabricator
Date May 3, 2021, 12:07 p.m.
Message ID <differential-rev-PHID-DREV-pxktuf7afkebonqstkbb-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48908/
State Superseded
Headers show

Comments

phabricator - May 3, 2021, 12:07 p.m.
marmoute created this revision.
Herald added a reviewer: indygreg.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/revlog.py

CHANGE DETAILS




To: marmoute, indygreg, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -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: