You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2015/12/12 19:57:59 UTC
[2/3] mesos git commit: Added '--chain' option to apply-reviews.py.
Added '--chain' option to apply-reviews.py.
Review: https://reviews.apache.org/r/39420
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/68cefcba
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/68cefcba
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/68cefcba
Branch: refs/heads/master
Commit: 68cefcbae365796a65b22450297c4207cf276955
Parents: c3e7ee7
Author: Artem Harutyunyan <ar...@mesosphere.io>
Authored: Sat Dec 12 10:51:01 2015 -0800
Committer: Joris Van Remoortere <jo...@gmail.com>
Committed: Sat Dec 12 10:53:47 2015 -0800
----------------------------------------------------------------------
support/apply-reviews.py | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/68cefcba/support/apply-reviews.py
----------------------------------------------------------------------
diff --git a/support/apply-reviews.py b/support/apply-reviews.py
index 7ef447b..b8a0b6d 100755
--- a/support/apply-reviews.py
+++ b/support/apply-reviews.py
@@ -285,6 +285,9 @@ def parse_options():
parser.add_argument('-n', '--no-amend',
action='store_true',
help='Do not amend commit message.')
+ parser.add_argument('-c', '--chain',
+ action='store_true',
+ help='Recursively apply parent review chain.')
# Add -g and -r and make them mutually exclusive.
group = parser.add_mutually_exclusive_group(required=True)
@@ -301,19 +304,21 @@ def parse_options():
options['dry_run'] = args.dry_run
options['no_amend'] = args.no_amend
options['github'] = args.github
+ options['chain'] = args.chain
def reviewboard():
- """Applies a chain of reviewboard patches."""
- # Retrieve the list of reviews to apply.
- reviews = review_chain(options['review_id'])
-
- applied = set()
- for review_id, summary in reviews:
- if review_id not in applied:
- applied.add(review_id)
- options['review_id'] = review_id
- apply_review()
+ """Applies either a chain of reviewboard patches or a single patch."""
+ if options['chain']:
+ # Retrieve the list of reviews to apply.
+ applied = set()
+ for review_id, summary in review_chain(options['review_id']):
+ if review_id not in applied:
+ applied.add(review_id)
+ options['review_id'] = review_id
+ apply_review()
+ else:
+ apply_review()
def github():