Mercurial > public > mercurial-scm > hg-stable
diff mercurial/linelog.py @ 38849:57af5ee15b35
linelog: port to Python 3
Differential Revision: https://phab.mercurial-scm.org/D4051
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 01 Aug 2018 23:25:35 -0400 |
parents | f956dc7217fc |
children | 6fed8b323651 |
line wrap: on
line diff
--- a/mercurial/linelog.py Sat Jul 28 17:42:36 2018 -0700 +++ b/mercurial/linelog.py Wed Aug 01 23:25:35 2018 -0400 @@ -98,7 +98,7 @@ self._target = op2 def __str__(self): - return 'JGE %d %d' % (self._cmprev, self._target) + return r'JGE %d %d' % (self._cmprev, self._target) def __eq__(self, other): return (type(self) == type(other) @@ -122,7 +122,7 @@ self._target = op2 def __str__(self): - return 'JUMP %d' % (self._target) + return r'JUMP %d' % (self._target) def __eq__(self, other): return (type(self) == type(other) @@ -144,7 +144,7 @@ raise LineLogError("malformed EOF, op2 must be 0, got %d" % op2) def __str__(self): - return 'EOF' + return r'EOF' def __eq__(self, other): return type(self) == type(other) @@ -163,7 +163,7 @@ self._target = op2 def __str__(self): - return 'JL %d %d' % (self._cmprev, self._target) + return r'JL %d %d' % (self._cmprev, self._target) def __eq__(self, other): return (type(self) == type(other) @@ -188,7 +188,7 @@ self._origlineno = op2 def __str__(self): - return 'LINE %d %d' % (self._rev, self._origlineno) + return r'LINE %d %d' % (self._rev, self._origlineno) def __eq__(self, other): return (type(self) == type(other) @@ -245,8 +245,8 @@ hex(id(self)), self._maxrev, len(self._program)) def debugstr(self): - fmt = '%%%dd %%s' % len(str(len(self._program))) - return '\n'.join( + fmt = r'%%%dd %%s' % len(str(len(self._program))) + return pycompat.sysstr('\n').join( fmt % (idx, i) for idx, i in enumerate(self._program[1:], 1)) @classmethod