diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -2492,9 +2492,9 @@ chompline = line.rstrip('\n') # highlight tabs and trailing whitespace stripline = chompline.rstrip() - if line[0] == '-': + if line[0:1] == '-': label = 'diff.deleted' - elif line[0] == '+': + elif line[0:1] == '+': label = 'diff.inserted' else: raise error.ProgrammingError('unexpected hunk line: %s' % line) @@ -2515,9 +2515,9 @@ a = '' b = '' for line in hunklines: - if line[0] == '-': + if line[0:1] == '-': a += line[1:] - elif line[0] == '+': + elif line[0:1] == '+': b += line[1:] else: raise error.ProgrammingError('unexpected hunk line: %s' % line)