diff options
Diffstat (limited to 'subcmds/upload.py')
-rw-r--r-- | subcmds/upload.py | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/subcmds/upload.py b/subcmds/upload.py index 1172dadc..61b18bc2 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py | |||
@@ -154,6 +154,12 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ | |||
154 | p.add_option('-d', '--draft', | 154 | p.add_option('-d', '--draft', |
155 | action='store_true', dest='draft', default=False, | 155 | action='store_true', dest='draft', default=False, |
156 | help='If specified, upload as a draft.') | 156 | help='If specified, upload as a draft.') |
157 | p.add_option('-p', '--private', | ||
158 | action='store_true', dest='private', default=False, | ||
159 | help='If specified, upload as a private change.') | ||
160 | p.add_option('-w', '--wip', | ||
161 | action='store_true', dest='wip', default=False, | ||
162 | help='If specified, upload as a work-in-progress change.') | ||
157 | p.add_option('-D', '--destination', '--dest', | 163 | p.add_option('-D', '--destination', '--dest', |
158 | type='string', action='store', dest='dest_branch', | 164 | type='string', action='store', dest='dest_branch', |
159 | metavar='BRANCH', | 165 | metavar='BRANCH', |
@@ -198,7 +204,8 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ | |||
198 | commit_list = branch.commits | 204 | commit_list = branch.commits |
199 | 205 | ||
200 | destination = opt.dest_branch or project.dest_branch or project.revisionExpr | 206 | destination = opt.dest_branch or project.dest_branch or project.revisionExpr |
201 | print('Upload project %s/ to remote branch %s:' % (project.relpath, destination)) | 207 | print('Upload project %s/ to remote branch %s%s:' % |
208 | (project.relpath, destination, ' (draft)' if opt.draft else '')) | ||
202 | print(' branch %s (%2d commit%s, %s):' % ( | 209 | print(' branch %s (%2d commit%s, %s):' % ( |
203 | name, | 210 | name, |
204 | len(commit_list), | 211 | len(commit_list), |
@@ -377,7 +384,12 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ | |||
377 | branch.uploaded = False | 384 | branch.uploaded = False |
378 | continue | 385 | continue |
379 | 386 | ||
380 | branch.UploadForReview(people, auto_topic=opt.auto_topic, draft=opt.draft, dest_branch=destination) | 387 | branch.UploadForReview(people, |
388 | auto_topic=opt.auto_topic, | ||
389 | draft=opt.draft, | ||
390 | private=opt.private, | ||
391 | wip=opt.wip, | ||
392 | dest_branch=destination) | ||
381 | branch.uploaded = True | 393 | branch.uploaded = True |
382 | except UploadError as e: | 394 | except UploadError as e: |
383 | branch.error = e | 395 | branch.error = e |
@@ -463,8 +475,8 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ | |||
463 | self.manifest.topdir, | 475 | self.manifest.topdir, |
464 | self.manifest.manifestProject.GetRemote('origin').url, | 476 | self.manifest.manifestProject.GetRemote('origin').url, |
465 | abort_if_user_denies=True) | 477 | abort_if_user_denies=True) |
466 | pending_proj_names = [project.name for (project, avail) in pending] | 478 | pending_proj_names = [project.name for (project, available) in pending] |
467 | pending_worktrees = [project.worktree for (project, avail) in pending] | 479 | pending_worktrees = [project.worktree for (project, available) in pending] |
468 | try: | 480 | try: |
469 | hook.Run(opt.allow_all_hooks, project_list=pending_proj_names, | 481 | hook.Run(opt.allow_all_hooks, project_list=pending_proj_names, |
470 | worktree_list=pending_worktrees) | 482 | worktree_list=pending_worktrees) |