diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -2431,9 +2431,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)