diff options
| -rw-r--r-- | project.py | 10 | ||||
| -rw-r--r-- | subcmds/upload.py | 6 |
2 files changed, 2 insertions, 14 deletions
| @@ -202,7 +202,6 @@ class ReviewableBranch(object): | |||
| 202 | auto_topic=False, | 202 | auto_topic=False, |
| 203 | hashtags=(), | 203 | hashtags=(), |
| 204 | labels=(), | 204 | labels=(), |
| 205 | draft=False, | ||
| 206 | private=False, | 205 | private=False, |
| 207 | notify=None, | 206 | notify=None, |
| 208 | wip=False, | 207 | wip=False, |
| @@ -215,7 +214,6 @@ class ReviewableBranch(object): | |||
| 215 | auto_topic=auto_topic, | 214 | auto_topic=auto_topic, |
| 216 | hashtags=hashtags, | 215 | hashtags=hashtags, |
| 217 | labels=labels, | 216 | labels=labels, |
| 218 | draft=draft, | ||
| 219 | private=private, | 217 | private=private, |
| 220 | notify=notify, | 218 | notify=notify, |
| 221 | wip=wip, | 219 | wip=wip, |
| @@ -1349,7 +1347,6 @@ class Project(object): | |||
| 1349 | auto_topic=False, | 1347 | auto_topic=False, |
| 1350 | hashtags=(), | 1348 | hashtags=(), |
| 1351 | labels=(), | 1349 | labels=(), |
| 1352 | draft=False, | ||
| 1353 | private=False, | 1350 | private=False, |
| 1354 | notify=None, | 1351 | notify=None, |
| 1355 | wip=False, | 1352 | wip=False, |
| @@ -1399,12 +1396,7 @@ class Project(object): | |||
| 1399 | if dest_branch.startswith(R_HEADS): | 1396 | if dest_branch.startswith(R_HEADS): |
| 1400 | dest_branch = dest_branch[len(R_HEADS):] | 1397 | dest_branch = dest_branch[len(R_HEADS):] |
| 1401 | 1398 | ||
| 1402 | upload_type = 'for' | 1399 | ref_spec = '%s:refs/for/%s' % (R_HEADS + branch.name, dest_branch) |
| 1403 | if draft: | ||
| 1404 | upload_type = 'drafts' | ||
| 1405 | |||
| 1406 | ref_spec = '%s:refs/%s/%s' % (R_HEADS + branch.name, upload_type, | ||
| 1407 | dest_branch) | ||
| 1408 | opts = [] | 1400 | opts = [] |
| 1409 | if auto_topic: | 1401 | if auto_topic: |
| 1410 | opts += ['topic=' + branch.name] | 1402 | opts += ['topic=' + branch.name] |
diff --git a/subcmds/upload.py b/subcmds/upload.py index 93f9c1e7..9c4337dc 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py | |||
| @@ -173,9 +173,6 @@ Gerrit Code Review: https://www.gerritcodereview.com/ | |||
| 173 | p.add_option('--cbr', '--current-branch', | 173 | p.add_option('--cbr', '--current-branch', |
| 174 | dest='current_branch', action='store_true', | 174 | dest='current_branch', action='store_true', |
| 175 | help='Upload current git branch.') | 175 | help='Upload current git branch.') |
| 176 | p.add_option('-d', '--draft', | ||
| 177 | action='store_true', dest='draft', default=False, | ||
| 178 | help='If specified, upload as a draft.') | ||
| 179 | p.add_option('--ne', '--no-emails', | 176 | p.add_option('--ne', '--no-emails', |
| 180 | action='store_false', dest='notify', default=True, | 177 | action='store_false', dest='notify', default=True, |
| 181 | help='If specified, do not send emails on upload.') | 178 | help='If specified, do not send emails on upload.') |
| @@ -247,7 +244,7 @@ Gerrit Code Review: https://www.gerritcodereview.com/ | |||
| 247 | 244 | ||
| 248 | destination = opt.dest_branch or project.dest_branch or project.revisionExpr | 245 | destination = opt.dest_branch or project.dest_branch or project.revisionExpr |
| 249 | print('Upload project %s/ to remote branch %s%s:' % | 246 | print('Upload project %s/ to remote branch %s%s:' % |
| 250 | (project.relpath, destination, ' (draft)' if opt.draft else '')) | 247 | (project.relpath, destination, ' (private)' if opt.private else '')) |
| 251 | print(' branch %s (%2d commit%s, %s):' % ( | 248 | print(' branch %s (%2d commit%s, %s):' % ( |
| 252 | name, | 249 | name, |
| 253 | len(commit_list), | 250 | len(commit_list), |
| @@ -468,7 +465,6 @@ Gerrit Code Review: https://www.gerritcodereview.com/ | |||
| 468 | auto_topic=opt.auto_topic, | 465 | auto_topic=opt.auto_topic, |
| 469 | hashtags=hashtags, | 466 | hashtags=hashtags, |
| 470 | labels=labels, | 467 | labels=labels, |
| 471 | draft=opt.draft, | ||
| 472 | private=opt.private, | 468 | private=opt.private, |
| 473 | notify=None if opt.notify else 'NONE', | 469 | notify=None if opt.notify else 'NONE', |
| 474 | wip=opt.wip, | 470 | wip=opt.wip, |
