From f609f91b72c0b90026da0eefcc0f52f12840971b Mon Sep 17 00:00:00 2001 From: Bryan Jacobs Date: Mon, 6 May 2013 13:36:24 -0400 Subject: Send reviews to a different branch from fetch This adds the ability to have reviews pushed to a different branch from the one on which changes are based. This is useful for "gateway" systems without smartsync. Change-Id: I3a8a0fabcaf6055e62d3fb55f89c944e2f81569f --- subcmds/upload.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'subcmds/upload.py') diff --git a/subcmds/upload.py b/subcmds/upload.py index 13b87784..4a22e26a 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py @@ -146,6 +146,10 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ p.add_option('-d', '--draft', action='store_true', dest='draft', default=False, help='If specified, upload as a draft.') + p.add_option('-D', '--destination', '--dest', + type='string', action='store', dest='dest_branch', + metavar='BRANCH', + help='Submit for review on this target branch.') # Options relating to upload hook. Note that verify and no-verify are NOT # opposites of each other, which is why they store to different locations. @@ -185,7 +189,8 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ date = branch.date commit_list = branch.commits - print('Upload project %s/ to remote branch %s:' % (project.relpath, project.revisionExpr)) + destination = project.dest_branch or project.revisionExpr + print('Upload project %s/ to remote branch %s:' % (project.relpath, destination)) print(' branch %s (%2d commit%s, %s):' % ( name, len(commit_list), @@ -336,7 +341,7 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ key = 'review.%s.uploadtopic' % branch.project.remote.review opt.auto_topic = branch.project.config.GetBoolean(key) - branch.UploadForReview(people, auto_topic=opt.auto_topic, draft=opt.draft) + branch.UploadForReview(people, auto_topic=opt.auto_topic, draft=opt.draft, dest_branch=opt.dest_branch) branch.uploaded = True except UploadError as e: branch.error = e -- cgit v1.2.3-54-g00ecf