Mercurial > public > mercurial-scm > hg
diff 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 |
line wrap: on
line diff
--- a/mercurial/commands.py Wed Oct 05 19:27:35 2005 -0700 +++ b/mercurial/commands.py Sat Oct 15 15:04:22 2005 -0700 @@ -1139,7 +1139,12 @@ strip = opts["strip"] mailre = re.compile(r'(?:From |[\w-]+:)') - diffre = re.compile(r'(?:diff -|--- .*\s+\w+ \w+ +\d+ \d+:\d+:\d+ \d+)') + + # attempt to detect the start of a patch + # (this heuristic is borrowed from quilt) + diffre = re.compile(r'(?:Index:[ \t]|diff[ \t]|RCS file: |' + + 'retrieving revision [0-9]+(\.[0-9]+)*$|' + + '(---|\*\*\*)[ \t])') for patch in patches: ui.status("applying %s\n" % patch)