equal
deleted
inserted
replaced
176 |
176 |
177 # attempt to detect the start of a patch |
177 # attempt to detect the start of a patch |
178 # (this heuristic is borrowed from quilt) |
178 # (this heuristic is borrowed from quilt) |
179 diffre = re.compile(r'^(?:Index:[ \t]|diff[ \t]|RCS file: |' |
179 diffre = re.compile(r'^(?:Index:[ \t]|diff[ \t]|RCS file: |' |
180 r'retrieving revision [0-9]+(\.[0-9]+)*$|' |
180 r'retrieving revision [0-9]+(\.[0-9]+)*$|' |
181 r'(---|\*\*\*)[ \t])', re.MULTILINE) |
181 r'(---|\*\*\*)[ \t].*?' |
|
182 r'^(\+\+\+|\*\*\*)[ \t])', re.MULTILINE|re.DOTALL) |
182 |
183 |
183 fd, tmpname = tempfile.mkstemp(prefix='hg-patch-') |
184 fd, tmpname = tempfile.mkstemp(prefix='hg-patch-') |
184 tmpfp = os.fdopen(fd, 'w') |
185 tmpfp = os.fdopen(fd, 'w') |
185 try: |
186 try: |
186 msg = email.Parser.Parser().parse(fileobj) |
187 msg = email.Parser.Parser().parse(fileobj) |