comparison mercurial/commands.py @ 1390:ce95599eedac

Borrow patch header detection heuristic from quilt
author Matt Mackall <mpm@selenic.com>
date Sat, 15 Oct 2005 15:04:22 -0700
parents c29c36745c6e
children c2eb204917f8
comparison
equal deleted inserted replaced
1389:9b3ef6f3cef5 1390:ce95599eedac
1137 1137
1138 d = opts["base"] 1138 d = opts["base"]
1139 strip = opts["strip"] 1139 strip = opts["strip"]
1140 1140
1141 mailre = re.compile(r'(?:From |[\w-]+:)') 1141 mailre = re.compile(r'(?:From |[\w-]+:)')
1142 diffre = re.compile(r'(?:diff -|--- .*\s+\w+ \w+ +\d+ \d+:\d+:\d+ \d+)') 1142
1143 # attempt to detect the start of a patch
1144 # (this heuristic is borrowed from quilt)
1145 diffre = re.compile(r'(?:Index:[ \t]|diff[ \t]|RCS file: |' +
1146 'retrieving revision [0-9]+(\.[0-9]+)*$|' +
1147 '(---|\*\*\*)[ \t])')
1143 1148
1144 for patch in patches: 1149 for patch in patches:
1145 ui.status("applying %s\n" % patch) 1150 ui.status("applying %s\n" % patch)
1146 pf = os.path.join(d, patch) 1151 pf = os.path.join(d, patch)
1147 1152