From 691a75936d517f05aaa4a5b0f477d9af5f301b6f Mon Sep 17 00:00:00 2001 From: Bryan Jacobs Date: Fri, 31 May 2013 15:45:28 -0400 Subject: [PATCH] Fix a few issues with dest-branch and multiples This fixes dest-branch display with >1 branch being uploaded to at once, and correctly handles setting the target branch in that case. Change-Id: If5e9c7ece02cc0d903e2cb377485ebea73a07107 --- subcmds/upload.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/subcmds/upload.py b/subcmds/upload.py index 4a22e26a..0c74738c 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py @@ -230,12 +230,13 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ if b: script.append('#') + destination = opt.dest_branch or project.dest_branch or project.revisionExpr script.append('# branch %s (%2d commit%s, %s) to remote branch %s:' % ( name, len(commit_list), len(commit_list) != 1 and 's' or '', date, - project.revisionExpr)) + destination)) for commit in commit_list: script.append('# %s' % commit) b[name] = branch @@ -341,7 +342,8 @@ 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, dest_branch=opt.dest_branch) + destination = opt.dest_branch or branch.project.dest_branch or branch.project.revisionExpr + branch.UploadForReview(people, auto_topic=opt.auto_topic, draft=opt.draft, dest_branch=destination) branch.uploaded = True except UploadError as e: branch.error = e