diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -1013,6 +1013,7 @@ self._generated = None self.mandatory = mandatory + @encoding.strmethod def __repr__(self): cls = b"%s.%s" % (self.__class__.__module__, self.__class__.__name__) return b'<%s object at %x; id: %s; type: %s; mandatory: %s>' % ( diff --git a/mercurial/linelog.py b/mercurial/linelog.py --- a/mercurial/linelog.py +++ b/mercurial/linelog.py @@ -255,7 +255,7 @@ ) def __repr__(self): - return b'' % ( + return '' % ( hex(id(self)), self._maxrev, len(self._program), diff --git a/mercurial/manifest.py b/mercurial/manifest.py --- a/mercurial/manifest.py +++ b/mercurial/manifest.py @@ -21,6 +21,7 @@ ) from .pycompat import getattr from . import ( + encoding, error, mdiff, pathutil, @@ -867,9 +868,10 @@ self._loadalllazy() return not self._dirs or all(m._isempty() for m in self._dirs.values()) + @encoding.strmethod def __repr__(self): return ( - b'' + b'' % ( self._dir, hex(self._node), diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -1090,6 +1090,7 @@ def filename(self): return self.header.filename() + @encoding.strmethod def __repr__(self): return b'' % (self.filename(), self.fromline)