##// END OF EJS Templates
Fortify the recognition of a diff header.
bos@serpentine.internal.keyresearch.com -
r1193:04d1ca8a default
parent child Browse files
Show More
@@ -1009,7 +1009,8 b' def import_(ui, repo, patch1, *patches, '
1009 d = opts["base"]
1009 d = opts["base"]
1010 strip = opts["strip"]
1010 strip = opts["strip"]
1011
1011
1012 mailre = re.compile(r'(From |[\w-]+:)')
1012 mailre = re.compile(r'(?:From |[\w-]+:)')
1013 diffre = re.compile(r'(?:diff -|--- .*\s+\w+ \w+ +\d+ \d+:\d+:\d+ \d+)')
1013
1014
1014 for patch in patches:
1015 for patch in patches:
1015 ui.status("applying %s\n" % patch)
1016 ui.status("applying %s\n" % patch)
@@ -1024,7 +1025,7 b' def import_(ui, repo, patch1, *patches, '
1024 if len(line) > 35: line = line[:32] + '...'
1025 if len(line) > 35: line = line[:32] + '...'
1025 raise util.Abort('first line looks like a '
1026 raise util.Abort('first line looks like a '
1026 'mail header: ' + line)
1027 'mail header: ' + line)
1027 if line.startswith("--- ") or line.startswith("diff -r"):
1028 if diffre.match(line):
1028 break
1029 break
1029 elif hgpatch:
1030 elif hgpatch:
1030 # parse values when importing the result of an hg export
1031 # parse values when importing the result of an hg export
General Comments 0
You need to be logged in to leave comments. Login now