Add support for Gerrit 2.2.2's "Draft" status
Change-Id: Ic5fd9a68641cb502711ff3f64ee4204bf5482571
This commit is contained in:
parent
ca006c3a48
commit
9850b4d630
1
AUTHORS
1
AUTHORS
@ -1,3 +1,4 @@
|
|||||||
Monty Taylor <mordred@inaugust.com>
|
Monty Taylor <mordred@inaugust.com>
|
||||||
James E. Blair <james.blair@rackspace.com>
|
James E. Blair <james.blair@rackspace.com>
|
||||||
Saggi Mizrahi <smizrahi@redhat.com>
|
Saggi Mizrahi <smizrahi@redhat.com>
|
||||||
|
Kiall Mac Innes <kiall@managedit.ie>
|
||||||
|
16
git-review
16
git-review
@ -554,6 +554,8 @@ def main():
|
|||||||
|
|
||||||
parser.add_argument("-t", "--topic", dest="topic",
|
parser.add_argument("-t", "--topic", dest="topic",
|
||||||
help="Topic to submit branch to")
|
help="Topic to submit branch to")
|
||||||
|
parser.add_argument("-D", "--draft", dest="draft", action="store_true",
|
||||||
|
help="Submit review as a draft")
|
||||||
parser.add_argument("-n", "--dry-run", dest="dry", action="store_true",
|
parser.add_argument("-n", "--dry-run", dest="dry", action="store_true",
|
||||||
help="Don't actually submit the branch for review")
|
help="Don't actually submit the branch for review")
|
||||||
parser.add_argument("-r", "--remote", dest="remote",
|
parser.add_argument("-r", "--remote", dest="remote",
|
||||||
@ -583,8 +585,8 @@ def main():
|
|||||||
version='%s version %s' % \
|
version='%s version %s' % \
|
||||||
(os.path.split(sys.argv[0])[-1], version))
|
(os.path.split(sys.argv[0])[-1], version))
|
||||||
parser.add_argument("branch", nargs="?", default=config['defaultbranch'])
|
parser.add_argument("branch", nargs="?", default=config['defaultbranch'])
|
||||||
parser.set_defaults(dry=False, rebase=True, verbose=False, update=False,
|
parser.set_defaults(dry=False, draft=False, rebase=True, verbose=False,
|
||||||
setup=False, yes=False, remote="gerrit")
|
update=False, setup=False, yes=False, remote="gerrit")
|
||||||
|
|
||||||
options = parser.parse_args()
|
options = parser.parse_args()
|
||||||
|
|
||||||
@ -629,7 +631,15 @@ def main():
|
|||||||
print_exit_message(1, needs_update)
|
print_exit_message(1, needs_update)
|
||||||
assert_one_change(remote, branch, yes, have_hook)
|
assert_one_change(remote, branch, yes, have_hook)
|
||||||
|
|
||||||
cmd = "git push %s HEAD:refs/for/%s/%s" % (remote, branch, topic)
|
# NOTE (kiall): Change to "publish" after 2.2.2 is deployed,
|
||||||
|
# before refs/for/ is deprecated
|
||||||
|
ref = "for"
|
||||||
|
|
||||||
|
if options.draft:
|
||||||
|
ref = "draft"
|
||||||
|
|
||||||
|
cmd = "git push %s HEAD:refs/%s/%s/%s" % (remote, ref, branch,
|
||||||
|
topic)
|
||||||
if options.dry:
|
if options.dry:
|
||||||
print "Please use the following command " \
|
print "Please use the following command " \
|
||||||
"to send your commits to review:\n"
|
"to send your commits to review:\n"
|
||||||
|
@ -44,6 +44,10 @@ submitting local changes to a \fIGerrit\fP server for review.
|
|||||||
.sp
|
.sp
|
||||||
Sets the target topic for this change on the gerrit server.
|
Sets the target topic for this change on the gerrit server.
|
||||||
.TP
|
.TP
|
||||||
|
.B \-\-draft, \-D
|
||||||
|
.sp
|
||||||
|
Submit review as a draft
|
||||||
|
.TP
|
||||||
.B \-\-dry\-run, \-n
|
.B \-\-dry\-run, \-n
|
||||||
.sp
|
.sp
|
||||||
Don\(aqt actually perform any commands that have direct effects. Print them
|
Don\(aqt actually perform any commands that have direct effects. Print them
|
||||||
|
Loading…
x
Reference in New Issue
Block a user