diff --git a/hgext/fastannotate/formatter.py b/hgext/fastannotate/formatter.py --- a/hgext/fastannotate/formatter.py +++ b/hgext/fastannotate/formatter.py @@ -103,7 +103,7 @@ class defaultformatter(object): result += ': ' + self.ui.label('-' + lines[i], 'diff.deleted') - if result[-1] != '\n': + if result[-1:] != '\n': result += '\n' self.ui.write(result) diff --git a/hgext/fastannotate/protocol.py b/hgext/fastannotate/protocol.py --- a/hgext/fastannotate/protocol.py +++ b/hgext/fastannotate/protocol.py @@ -98,7 +98,7 @@ def _parseresponse(payload): state = 0 # 0: vfspath, 1: size vfspath = size = '' while i < l: - ch = payload[i] + ch = payload[i:i + 1] if ch == '\0': if state == 1: result[vfspath] = buffer(payload, i + 1, int(size))