diff options
Diffstat (limited to 'subcmds/upload.py')
-rw-r--r-- | subcmds/upload.py | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/subcmds/upload.py b/subcmds/upload.py index 1172dadc..77eaf81a 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py | |||
@@ -154,6 +154,16 @@ 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.') | ||
163 | p.add_option('-o', '--push-option', | ||
164 | type='string', action='append', dest='push_options', | ||
165 | default=[], | ||
166 | help='Additional push options to transmit') | ||
157 | p.add_option('-D', '--destination', '--dest', | 167 | p.add_option('-D', '--destination', '--dest', |
158 | type='string', action='store', dest='dest_branch', | 168 | type='string', action='store', dest='dest_branch', |
159 | metavar='BRANCH', | 169 | metavar='BRANCH', |
@@ -175,6 +185,9 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ | |||
175 | # Never run upload hooks, but upload anyway (AKA bypass hooks). | 185 | # Never run upload hooks, but upload anyway (AKA bypass hooks). |
176 | # - no-verify=True, verify=True: | 186 | # - no-verify=True, verify=True: |
177 | # Invalid | 187 | # Invalid |
188 | p.add_option('--no-cert-checks', | ||
189 | dest='validate_certs', action='store_false', default=True, | ||
190 | help='Disable verifying ssl certs (unsafe).') | ||
178 | p.add_option('--no-verify', | 191 | p.add_option('--no-verify', |
179 | dest='bypass_hooks', action='store_true', | 192 | dest='bypass_hooks', action='store_true', |
180 | help='Do not run the upload hook.') | 193 | help='Do not run the upload hook.') |
@@ -198,7 +211,8 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ | |||
198 | commit_list = branch.commits | 211 | commit_list = branch.commits |
199 | 212 | ||
200 | destination = opt.dest_branch or project.dest_branch or project.revisionExpr | 213 | destination = opt.dest_branch or project.dest_branch or project.revisionExpr |
201 | print('Upload project %s/ to remote branch %s:' % (project.relpath, destination)) | 214 | print('Upload project %s/ to remote branch %s%s:' % |
215 | (project.relpath, destination, ' (draft)' if opt.draft else '')) | ||
202 | print(' branch %s (%2d commit%s, %s):' % ( | 216 | print(' branch %s (%2d commit%s, %s):' % ( |
203 | name, | 217 | name, |
204 | len(commit_list), | 218 | len(commit_list), |
@@ -377,7 +391,15 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ | |||
377 | branch.uploaded = False | 391 | branch.uploaded = False |
378 | continue | 392 | continue |
379 | 393 | ||
380 | branch.UploadForReview(people, auto_topic=opt.auto_topic, draft=opt.draft, dest_branch=destination) | 394 | branch.UploadForReview(people, |
395 | auto_topic=opt.auto_topic, | ||
396 | draft=opt.draft, | ||
397 | private=opt.private, | ||
398 | wip=opt.wip, | ||
399 | dest_branch=destination, | ||
400 | validate_certs=opt.validate_certs, | ||
401 | push_options=opt.push_options) | ||
402 | |||
381 | branch.uploaded = True | 403 | branch.uploaded = True |
382 | except UploadError as e: | 404 | except UploadError as e: |
383 | branch.error = e | 405 | branch.error = e |
@@ -463,8 +485,8 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ | |||
463 | self.manifest.topdir, | 485 | self.manifest.topdir, |
464 | self.manifest.manifestProject.GetRemote('origin').url, | 486 | self.manifest.manifestProject.GetRemote('origin').url, |
465 | abort_if_user_denies=True) | 487 | abort_if_user_denies=True) |
466 | pending_proj_names = [project.name for (project, avail) in pending] | 488 | pending_proj_names = [project.name for (project, available) in pending] |
467 | pending_worktrees = [project.worktree for (project, avail) in pending] | 489 | pending_worktrees = [project.worktree for (project, available) in pending] |
468 | try: | 490 | try: |
469 | hook.Run(opt.allow_all_hooks, project_list=pending_proj_names, | 491 | hook.Run(opt.allow_all_hooks, project_list=pending_proj_names, |
470 | worktree_list=pending_worktrees) | 492 | worktree_list=pending_worktrees) |