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.
--- 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)