comparison mercurial/revlog.py @ 47163:6bc7c467a7d1

revlog: use revlog.display_id in error related to bad revisions Differential Revision: https://phab.mercurial-scm.org/D10589
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 03 May 2021 12:24:50 +0200
parents dfe8074239de
children 04f2f94836a5
comparison
equal deleted inserted replaced
47162:dfe8074239de 47163:6bc7c467a7d1
2031 deltacomputer - an optional deltacomputer instance shared between 2031 deltacomputer - an optional deltacomputer instance shared between
2032 multiple calls 2032 multiple calls
2033 """ 2033 """
2034 if link == nullrev: 2034 if link == nullrev:
2035 raise error.RevlogError( 2035 raise error.RevlogError(
2036 _(b"attempted to add linkrev -1 to %s") % self._indexfile 2036 _(b"attempted to add linkrev -1 to %s") % self.display_id
2037 ) 2037 )
2038 2038
2039 if sidedata is None: 2039 if sidedata is None:
2040 sidedata = {} 2040 sidedata = {}
2041 elif sidedata and not self.hassidedata: 2041 elif sidedata and not self.hassidedata:
2227 - rawtext is optional (can be None); if not set, cachedelta must be set. 2227 - rawtext is optional (can be None); if not set, cachedelta must be set.
2228 if both are set, they must correspond to each other. 2228 if both are set, they must correspond to each other.
2229 """ 2229 """
2230 if node == self.nullid: 2230 if node == self.nullid:
2231 raise error.RevlogError( 2231 raise error.RevlogError(
2232 _(b"%s: attempt to add null revision") % self._indexfile 2232 _(b"%s: attempt to add null revision") % self.display_id
2233 ) 2233 )
2234 if ( 2234 if (
2235 node == self.nodeconstants.wdirid 2235 node == self.nodeconstants.wdirid
2236 or node in self.nodeconstants.wdirfilenodeids 2236 or node in self.nodeconstants.wdirfilenodeids
2237 ): 2237 ):
2238 raise error.RevlogError( 2238 raise error.RevlogError(
2239 _(b"%s: attempt to add wdir revision") % self._indexfile 2239 _(b"%s: attempt to add wdir revision") % self.display_id
2240 ) 2240 )
2241 2241
2242 if self._inline: 2242 if self._inline:
2243 fh = ifh 2243 fh = ifh
2244 else: 2244 else: