mercurial/patch.py
changeset 10884 4fb1bafd43e7
parent 10818 d14d45fae927
parent 10883 196908117c27
child 10905 13a1b2fb7ef2
equal deleted inserted replaced
10882:f0bfe42c7b1f 10884:4fb1bafd43e7
    45     '''return an iterator of individual patches from a stream'''
    45     '''return an iterator of individual patches from a stream'''
    46     def isheader(line, inheader):
    46     def isheader(line, inheader):
    47         if inheader and line[0] in (' ', '\t'):
    47         if inheader and line[0] in (' ', '\t'):
    48             # continuation
    48             # continuation
    49             return True
    49             return True
       
    50         if line[0] in (' ', '-', '+'):
       
    51             # diff line - don't check for header pattern in there
       
    52             return False
    50         l = line.split(': ', 1)
    53         l = line.split(': ', 1)
    51         return len(l) == 2 and ' ' not in l[0]
    54         return len(l) == 2 and ' ' not in l[0]
    52 
    55 
    53     def chunk(lines):
    56     def chunk(lines):
    54         return cStringIO.StringIO(''.join(lines))
    57         return cStringIO.StringIO(''.join(lines))