| 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:
|
|
|