diff -r 2da4144e6716 -r 1a31111e6239 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Sat Jan 27 17:13:51 2018 +0900 +++ b/mercurial/cmdutil.py Sat Jan 27 17:31:25 2018 +0900 @@ -1563,17 +1563,9 @@ if fo is not None: fo.close() -class _regrettablereprbytes(bytes): - """Bytes subclass that makes the repr the same on Python 3 as Python 2. - - This is a huge hack. - """ - def __repr__(self): - return repr(pycompat.sysstr(self)) - def _maybebytestr(v): - if pycompat.ispy3 and isinstance(v, bytes): - return _regrettablereprbytes(v) + if isinstance(v, bytes): + return pycompat.bytestr(v) return v def showmarker(fm, marker, index=None):