# HG changeset patch # User Yuya Nishihara # Date 1599980363 -32400 # Node ID bd5b2b29b82df1e2de214a59a8aa60eb80ee27f9 # Parent 4ebc5f325bedfc8fc98b3c41fda7892563142146 py3: fix formatting of LookupError for workingctx Spotted while writing broken tests for "hg grep -fr'wdir()'". basectx._fileinfo() raises ManifestLookupError(self._node, ..), but _node of the workingctx is None for historical reasons. diff -r 4ebc5f325bed -r bd5b2b29b82d mercurial/error.py --- a/mercurial/error.py Fri Sep 11 14:41:05 2020 +0900 +++ b/mercurial/error.py Sun Sep 13 15:59:23 2020 +0900 @@ -73,7 +73,10 @@ from .node import short name = short(name) - RevlogError.__init__(self, b'%s@%s: %s' % (index, name, message)) + # if name is a binary node, it can be None + RevlogError.__init__( + self, b'%s@%s: %s' % (index, pycompat.bytestr(name), message) + ) def __bytes__(self): return RevlogError.__bytes__(self)