summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Jacobs <bryanrj@gmail.com>2013-05-31 15:45:28 -0400
committerBryan Jacobs <bryanrj@gmail.com>2013-06-03 10:39:43 -0400
commit691a75936d517f05aaa4a5b0f477d9af5f301b6f (patch)
treeee61b4dcb91aeb0ea2d60fa720aa037faed7e585
parenta1f77d92c65028a55202062594cb379b6503bf60 (diff)
downloadgit-repo-691a75936d517f05aaa4a5b0f477d9af5f301b6f.tar.gz
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
-rw-r--r--subcmds/upload.py6
1 files 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/
230 230
231 if b: 231 if b:
232 script.append('#') 232 script.append('#')
233 destination = opt.dest_branch or project.dest_branch or project.revisionExpr
233 script.append('# branch %s (%2d commit%s, %s) to remote branch %s:' % ( 234 script.append('# branch %s (%2d commit%s, %s) to remote branch %s:' % (
234 name, 235 name,
235 len(commit_list), 236 len(commit_list),
236 len(commit_list) != 1 and 's' or '', 237 len(commit_list) != 1 and 's' or '',
237 date, 238 date,
238 project.revisionExpr)) 239 destination))
239 for commit in commit_list: 240 for commit in commit_list:
240 script.append('# %s' % commit) 241 script.append('# %s' % commit)
241 b[name] = branch 242 b[name] = branch
@@ -341,7 +342,8 @@ Gerrit Code Review: http://code.google.com/p/gerrit/
341 key = 'review.%s.uploadtopic' % branch.project.remote.review 342 key = 'review.%s.uploadtopic' % branch.project.remote.review
342 opt.auto_topic = branch.project.config.GetBoolean(key) 343 opt.auto_topic = branch.project.config.GetBoolean(key)
343 344
344 branch.UploadForReview(people, auto_topic=opt.auto_topic, draft=opt.draft, dest_branch=opt.dest_branch) 345 destination = opt.dest_branch or branch.project.dest_branch or branch.project.revisionExpr
346 branch.UploadForReview(people, auto_topic=opt.auto_topic, draft=opt.draft, dest_branch=destination)
345 branch.uploaded = True 347 branch.uploaded = True
346 except UploadError as e: 348 except UploadError as e:
347 branch.error = e 349 branch.error = e