diff options
Diffstat (limited to 'subcmds')
-rw-r--r-- | subcmds/upload.py | 9 |
1 files changed, 7 insertions, 2 deletions
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/ | |||
146 | p.add_option('-d', '--draft', | 146 | p.add_option('-d', '--draft', |
147 | action='store_true', dest='draft', default=False, | 147 | action='store_true', dest='draft', default=False, |
148 | help='If specified, upload as a draft.') | 148 | help='If specified, upload as a draft.') |
149 | p.add_option('-D', '--destination', '--dest', | ||
150 | type='string', action='store', dest='dest_branch', | ||
151 | metavar='BRANCH', | ||
152 | help='Submit for review on this target branch.') | ||
149 | 153 | ||
150 | # Options relating to upload hook. Note that verify and no-verify are NOT | 154 | # Options relating to upload hook. Note that verify and no-verify are NOT |
151 | # opposites of each other, which is why they store to different locations. | 155 | # 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/ | |||
185 | date = branch.date | 189 | date = branch.date |
186 | commit_list = branch.commits | 190 | commit_list = branch.commits |
187 | 191 | ||
188 | print('Upload project %s/ to remote branch %s:' % (project.relpath, project.revisionExpr)) | 192 | destination = project.dest_branch or project.revisionExpr |
193 | print('Upload project %s/ to remote branch %s:' % (project.relpath, destination)) | ||
189 | print(' branch %s (%2d commit%s, %s):' % ( | 194 | print(' branch %s (%2d commit%s, %s):' % ( |
190 | name, | 195 | name, |
191 | len(commit_list), | 196 | len(commit_list), |
@@ -336,7 +341,7 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ | |||
336 | key = 'review.%s.uploadtopic' % branch.project.remote.review | 341 | key = 'review.%s.uploadtopic' % branch.project.remote.review |
337 | opt.auto_topic = branch.project.config.GetBoolean(key) | 342 | opt.auto_topic = branch.project.config.GetBoolean(key) |
338 | 343 | ||
339 | branch.UploadForReview(people, auto_topic=opt.auto_topic, draft=opt.draft) | 344 | branch.UploadForReview(people, auto_topic=opt.auto_topic, draft=opt.draft, dest_branch=opt.dest_branch) |
340 | branch.uploaded = True | 345 | branch.uploaded = True |
341 | except UploadError as e: | 346 | except UploadError as e: |
342 | branch.error = e | 347 | branch.error = e |