diff 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
line wrap: on
line diff
--- a/mercurial/patch.py	Thu Feb 18 10:32:51 2010 +0100
+++ b/mercurial/patch.py	Thu Feb 18 10:46:01 2010 -0800
@@ -157,8 +157,8 @@
             if line.split(':', 1)[0].lower() in mimeheaders:
                 # let email parser handle this
                 return mimesplit(stream, cur)
-        elif inheader:
-            # No evil headers seen, split by hand
+        elif line.startswith('--- ') and inheader:
+            # No evil headers seen by diff start, split by hand
             return headersplit(stream, cur)
         # Not enough info, keep reading