Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(682)

Unified Diff: pending_manager.py

Issue 6055005: Add a function to detect patches that can't be safely applied. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/commit-queue
Patch Set: Rebase against trunk Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « patch.py ('k') | tests/patch_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « patch.py ('k') | tests/patch_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698