mercurial/diffhelpers.py
changeset 37575 230eb9594150
parent 37574 a1bcc7ff0eac
child 37802 090c89a8db32
equal deleted inserted replaced
37574:a1bcc7ff0eac 37575:230eb9594150
    31             if not s:
    31             if not s:
    32                 raise error.ParseError(_('incomplete hunk'))
    32                 raise error.ParseError(_('incomplete hunk'))
    33             if s == "\\ No newline at end of file\n":
    33             if s == "\\ No newline at end of file\n":
    34                 fixnewline(hunk, a, b)
    34                 fixnewline(hunk, a, b)
    35                 continue
    35                 continue
    36             if s == "\n":
    36             if s == '\n' or s == '\r\n':
    37                 # Some patches may be missing the control char
    37                 # Some patches may be missing the control char
    38                 # on empty lines. Supply a leading space.
    38                 # on empty lines. Supply a leading space.
    39                 s = " \n"
    39                 s = ' ' + s
    40             hunk.append(s)
    40             hunk.append(s)
    41             if s.startswith('+'):
    41             if s.startswith('+'):
    42                 b.append(s[1:])
    42                 b.append(s[1:])
    43             elif s.startswith('-'):
    43             elif s.startswith('-'):
    44                 a.append(s)
    44                 a.append(s)