Index: pending_manager.py |
diff --git a/pending_manager.py b/pending_manager.py |
index 09310f68a78538b3163776c995aaf84283065f9c..15574dcf4f14aa4fe4b6858d3386ba939216e40e 100644 |
--- a/pending_manager.py |
+++ b/pending_manager.py |
@@ -265,6 +265,9 @@ class PendingManager(object): |
def _apply_patch(self, pending, revision): |
"""Applies the pending patch to the checkout and throws if it fails.""" |
patch_data = urllib2.urlopen(pending.patch_url()).read() |
+ error = patch.verify_patch(patch_data) |
+ if error: |
+ raise base.DiscardPending(pending, 'Can\'t process patch: %s' % error) |
patch_data = patch.auto_mangle_git_patch(patch_data) |
if not self.checkout.apply_patch(patch_data): |
raise base.DiscardPending(pending, |