Chromium Code Reviews

Unified Diff: pending_manager.py

Issue 6880115: Add post_processing code to update copyright year automatically. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/commit-queue
Patch Set: Significantly simplify code Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « no previous file | post_processors/__init__.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 bc8ab15f9f60e479da3c27a3a4bac78b9c810b0a..5fa6508bd316e77f2dd32e3bf7a825910fd55d63 100644
--- a/pending_manager.py
+++ b/pending_manager.py
@@ -1,5 +1,5 @@
# coding=utf8
-# Copyright (c) 2010 The Chromium Authors. All rights reserved.
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Commit queue manager class.
@@ -112,18 +112,22 @@ class PendingManager(object):
and then commit the patches with checkout.
"""
- def __init__(self, rietveld, checkout_obj, pre_patch_verifiers, verifiers):
+ def __init__(self, rietveld, checkout_obj, pre_patch_verifiers, verifiers,
+ post_process):
"""
Args:
pre_patch_verifiers: Verifiers objects that are run before applying the
patch.
verifiers: Verifiers object run after applying the patch.
+ post_process: List of lambda(checkout, patches) functions that post
+ process an applied patch.
"""
assert len(pre_patch_verifiers) or len(verifiers)
self.rietveld = rietveld
self.checkout = checkout_obj
- self.pre_patch_verifiers = pre_patch_verifiers
- self.verifiers = verifiers
+ self.pre_patch_verifiers = pre_patch_verifiers or []
+ self.verifiers = verifiers or []
+ self.post_process = post_process or []
self.all_verifiers = pre_patch_verifiers + verifiers
self.queue = PendingQueue()
# Assert names are unique.
@@ -296,7 +300,7 @@ class PendingManager(object):
if not pending.files:
raise base.DiscardPending(
pending, 'No file was found in this patchset.')
- self.checkout.apply_patch(patches)
+ self.checkout.apply_patch(patches, self.post_process)
except checkout.PatchApplicationFailed, e:
out = 'Can\'t apply patch for file %s.' % e.filename
if e.status:
« no previous file with comments | « no previous file | post_processors/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine