comparison mercurial/patch.py @ 10501:a27af7229850 stable

import: if in doubt, consume stream until start of diff This prevents a header-like line in the message body from causing a spurious split.
author Brendan Cully <brendan@kublai.com>
date Thu, 18 Feb 2010 10:46:01 -0800
parents 16c68fd720ab
children 5fe51d348daf
comparison
equal deleted inserted replaced
10500:e96597c8d0ea 10501:a27af7229850
155 elif isheader(line, inheader): 155 elif isheader(line, inheader):
156 inheader = True 156 inheader = True
157 if line.split(':', 1)[0].lower() in mimeheaders: 157 if line.split(':', 1)[0].lower() in mimeheaders:
158 # let email parser handle this 158 # let email parser handle this
159 return mimesplit(stream, cur) 159 return mimesplit(stream, cur)
160 elif inheader: 160 elif line.startswith('--- ') and inheader:
161 # No evil headers seen, split by hand 161 # No evil headers seen by diff start, split by hand
162 return headersplit(stream, cur) 162 return headersplit(stream, cur)
163 # Not enough info, keep reading 163 # Not enough info, keep reading
164 164
165 # if we are here, we have a very plain patch 165 # if we are here, we have a very plain patch
166 return remainder(cur) 166 return remainder(cur)