You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2015/05/21 02:18:42 UTC
[3/3] mesos git commit: Allowed post-reviews.py to configure tracking
branch.
Allowed post-reviews.py to configure tracking branch.
Review: https://reviews.apache.org/r/34488
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/80437f38
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/80437f38
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/80437f38
Branch: refs/heads/master
Commit: 80437f3862aa34202497b4dbac7c8c94c6f4c008
Parents: 2e33379
Author: Jie Yu <yu...@gmail.com>
Authored: Wed May 20 11:40:14 2015 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Wed May 20 17:17:31 2015 -0700
----------------------------------------------------------------------
support/post-reviews.py | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/80437f38/support/post-reviews.py
----------------------------------------------------------------------
diff --git a/support/post-reviews.py b/support/post-reviews.py
index 485b2f9..5733298 100755
--- a/support/post-reviews.py
+++ b/support/post-reviews.py
@@ -22,6 +22,7 @@
# NOTE: post-reviews is currently specific to Mesos development,
# but can easily be adapted for other projects.
+import argparse
import atexit
import os
import sys
@@ -85,7 +86,13 @@ if diff_stat:
top_level_dir = execute(['git', 'rev-parse', '--show-toplevel']).strip()
-tracking_branch = 'master'
+# Use the tracking_branch specified by the user if exists.
+# TODO(jieyu): Parse .reviewboardrc as well.
+parser = argparse.ArgumentParser(add_help=False)
+parser.add_argument('--tracking-branch')
+args, _ = parser.parse_known_args()
+
+tracking_branch = args.tracking_branch if args.tracking_branch else 'master'
branch_ref = execute(['git', 'symbolic-ref', 'HEAD']).strip()
branch = branch_ref.replace('refs/heads/', '', 1)
@@ -188,7 +195,11 @@ for i in range(len(shas)):
revision_range = previous + ':' + sha
# Build the post-review/rbt command up to the point where they are common.
- command = post_review + ['--tracking-branch=' + tracking_branch]
+ command = post_review
+
+ if args.tracking_branch is None:
+ command = command + ['--tracking-branch=' + tracking_branch]
+
if review_request_id:
command = command + ['--review-request-id=' + review_request_id]