Mercurial > public > mercurial-scm > hg
diff mercurial/smartset.py @ 36265:b44fac3a49fb
py3: factor out byterepr() which returns an asciified value on py3
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 17 Feb 2018 18:09:56 +0900 |
parents | fc44c2657dc5 |
children | f3033692ccef |
line wrap: on
line diff
--- a/mercurial/smartset.py Thu Feb 15 17:14:45 2018 +0530 +++ b/mercurial/smartset.py Sat Feb 17 18:09:56 2018 +0900 @@ -35,7 +35,7 @@ elif callable(r): return r() else: - return pycompat.sysbytes(repr(r)) + return pycompat.byterepr(r) def _typename(o): return pycompat.sysbytes(type(o).__name__).lstrip('_') @@ -400,7 +400,7 @@ # We fallback to the sorted version for a stable output. if self._ascending is not None: l = self._asclist - s = pycompat.sysbytes(repr(l)) + s = pycompat.byterepr(l) return '<%s%s %s>' % (_typename(self), d, s) class filteredset(abstractsmartset): @@ -513,7 +513,7 @@ @encoding.strmethod def __repr__(self): - xs = [pycompat.sysbytes(repr(self._subset))] + xs = [pycompat.byterepr(self._subset)] s = _formatsetrepr(self._condrepr) if s: xs.append(s) @@ -1132,7 +1132,7 @@ def prettyformat(revs): lines = [] - rs = pycompat.sysbytes(repr(revs)) + rs = pycompat.byterepr(revs) p = 0 while p < len(rs): q = rs.find('<', p + 1)