mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-01-02 16:14:25 +00:00
upload: drop support for drafts
Draft CLs were replaced by private/wip CLs in Gerrit instead years ago. Change-Id: If4f3d6606aad40a6f1617a49681dfd45c64d3d37 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256673 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
parent
4c418bf423
commit
b0fbc7fb58
10
project.py
10
project.py
@ -202,7 +202,6 @@ class ReviewableBranch(object):
|
|||||||
auto_topic=False,
|
auto_topic=False,
|
||||||
hashtags=(),
|
hashtags=(),
|
||||||
labels=(),
|
labels=(),
|
||||||
draft=False,
|
|
||||||
private=False,
|
private=False,
|
||||||
notify=None,
|
notify=None,
|
||||||
wip=False,
|
wip=False,
|
||||||
@ -215,7 +214,6 @@ class ReviewableBranch(object):
|
|||||||
auto_topic=auto_topic,
|
auto_topic=auto_topic,
|
||||||
hashtags=hashtags,
|
hashtags=hashtags,
|
||||||
labels=labels,
|
labels=labels,
|
||||||
draft=draft,
|
|
||||||
private=private,
|
private=private,
|
||||||
notify=notify,
|
notify=notify,
|
||||||
wip=wip,
|
wip=wip,
|
||||||
@ -1349,7 +1347,6 @@ class Project(object):
|
|||||||
auto_topic=False,
|
auto_topic=False,
|
||||||
hashtags=(),
|
hashtags=(),
|
||||||
labels=(),
|
labels=(),
|
||||||
draft=False,
|
|
||||||
private=False,
|
private=False,
|
||||||
notify=None,
|
notify=None,
|
||||||
wip=False,
|
wip=False,
|
||||||
@ -1399,12 +1396,7 @@ class Project(object):
|
|||||||
if dest_branch.startswith(R_HEADS):
|
if dest_branch.startswith(R_HEADS):
|
||||||
dest_branch = dest_branch[len(R_HEADS):]
|
dest_branch = dest_branch[len(R_HEADS):]
|
||||||
|
|
||||||
upload_type = 'for'
|
ref_spec = '%s:refs/for/%s' % (R_HEADS + branch.name, dest_branch)
|
||||||
if draft:
|
|
||||||
upload_type = 'drafts'
|
|
||||||
|
|
||||||
ref_spec = '%s:refs/%s/%s' % (R_HEADS + branch.name, upload_type,
|
|
||||||
dest_branch)
|
|
||||||
opts = []
|
opts = []
|
||||||
if auto_topic:
|
if auto_topic:
|
||||||
opts += ['topic=' + branch.name]
|
opts += ['topic=' + branch.name]
|
||||||
|
@ -173,9 +173,6 @@ Gerrit Code Review: https://www.gerritcodereview.com/
|
|||||||
p.add_option('--cbr', '--current-branch',
|
p.add_option('--cbr', '--current-branch',
|
||||||
dest='current_branch', action='store_true',
|
dest='current_branch', action='store_true',
|
||||||
help='Upload current git branch.')
|
help='Upload current git branch.')
|
||||||
p.add_option('-d', '--draft',
|
|
||||||
action='store_true', dest='draft', default=False,
|
|
||||||
help='If specified, upload as a draft.')
|
|
||||||
p.add_option('--ne', '--no-emails',
|
p.add_option('--ne', '--no-emails',
|
||||||
action='store_false', dest='notify', default=True,
|
action='store_false', dest='notify', default=True,
|
||||||
help='If specified, do not send emails on upload.')
|
help='If specified, do not send emails on upload.')
|
||||||
@ -247,7 +244,7 @@ Gerrit Code Review: https://www.gerritcodereview.com/
|
|||||||
|
|
||||||
destination = opt.dest_branch or project.dest_branch or project.revisionExpr
|
destination = opt.dest_branch or project.dest_branch or project.revisionExpr
|
||||||
print('Upload project %s/ to remote branch %s%s:' %
|
print('Upload project %s/ to remote branch %s%s:' %
|
||||||
(project.relpath, destination, ' (draft)' if opt.draft else ''))
|
(project.relpath, destination, ' (private)' if opt.private else ''))
|
||||||
print(' branch %s (%2d commit%s, %s):' % (
|
print(' branch %s (%2d commit%s, %s):' % (
|
||||||
name,
|
name,
|
||||||
len(commit_list),
|
len(commit_list),
|
||||||
@ -468,7 +465,6 @@ Gerrit Code Review: https://www.gerritcodereview.com/
|
|||||||
auto_topic=opt.auto_topic,
|
auto_topic=opt.auto_topic,
|
||||||
hashtags=hashtags,
|
hashtags=hashtags,
|
||||||
labels=labels,
|
labels=labels,
|
||||||
draft=opt.draft,
|
|
||||||
private=opt.private,
|
private=opt.private,
|
||||||
notify=None if opt.notify else 'NONE',
|
notify=None if opt.notify else 'NONE',
|
||||||
wip=opt.wip,
|
wip=opt.wip,
|
||||||
|
Loading…
Reference in New Issue
Block a user