comparison mercurial/error.py @ 46651:6fc57680cfd6

error: remove shortening of node in error message This strips the complete 20 bytes node which was not found. Having the the full node in error message is important as it makes debugging easier. If a short node is to be displayed, that should be done by callers. Differential Revision: https://phab.mercurial-scm.org/D9994
author Pulkit Goyal <7895pulkit@gmail.com>
date Wed, 10 Feb 2021 17:24:54 +0530
parents 3941fe53670d
children e2f7b2695ba1
comparison
equal deleted inserted replaced
46650:2803f94b7431 46651:6fc57680cfd6
71 self.index = index 71 self.index = index
72 # this can't be called 'message' because at least some installs of 72 # this can't be called 'message' because at least some installs of
73 # Python 2.6+ complain about the 'message' property being deprecated 73 # Python 2.6+ complain about the 'message' property being deprecated
74 self.lookupmessage = message 74 self.lookupmessage = message
75 if isinstance(name, bytes) and len(name) == 20: 75 if isinstance(name, bytes) and len(name) == 20:
76 from .node import short 76 from .node import hex
77 77
78 name = short(name) 78 name = hex(name)
79 # if name is a binary node, it can be None 79 # if name is a binary node, it can be None
80 RevlogError.__init__( 80 RevlogError.__init__(
81 self, b'%s@%s: %s' % (index, pycompat.bytestr(name), message) 81 self, b'%s@%s: %s' % (index, pycompat.bytestr(name), message)
82 ) 82 )
83 83