Mercurial > public > mercurial-scm > hg-stable
diff hgext/record.py @ 18953:e4ae397595e8
record: abort on malformed patches instead of crashing
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Thu, 11 Apr 2013 19:03:33 +0200 |
parents | eeadc76a7575 |
children | b1639e98e8a1 |
line wrap: on
line diff
--- a/hgext/record.py Mon Apr 15 01:22:15 2013 +0900 +++ b/hgext/record.py Thu Apr 11 19:03:33 2013 +0200 @@ -531,7 +531,11 @@ fp.seek(0) # 1. filter patch, so we have intending-to apply subset of it - chunks = filterpatch(ui, parsepatch(fp)) + try: + chunks = filterpatch(ui, parsepatch(fp)) + except patch.PatchError, err: + raise util.Abort(_('error parsing patch: %s') % err) + del fp contenders = set()