changeset 10736:a528a1046dba stable

patch: second line of a context diff starts with '--- ', not '+++ '
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Fri, 19 Mar 2010 12:45:39 +0100
parents e26102c40e2e
children 0e8403f4ce31
files mercurial/patch.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/patch.py	Fri Mar 19 10:39:01 2010 +0100
+++ b/mercurial/patch.py	Fri Mar 19 12:45:39 2010 +0100
@@ -178,8 +178,8 @@
     # (this heuristic is borrowed from quilt)
     diffre = re.compile(r'^(?:Index:[ \t]|diff[ \t]|RCS file: |'
                         r'retrieving revision [0-9]+(\.[0-9]+)*$|'
-                        r'(---|\*\*\*)[ \t].*?'
-                        r'^(\+\+\+|\*\*\*)[ \t])', re.MULTILINE|re.DOTALL)
+                        r'---[ \t].*?^\+\+\+[ \t]|'
+                        r'\*\*\*[ \t].*?^---[ \t])', re.MULTILINE|re.DOTALL)
 
     fd, tmpname = tempfile.mkstemp(prefix='hg-patch-')
     tmpfp = os.fdopen(fd, 'w')