Skip to content

Commit

Permalink
Discontinue support for draft workflow
Browse files Browse the repository at this point in the history
As of gerrit 2.15 and later, draft workflow is replaced with
work-in-progress and private workflow. See this CL: [1] and this
issue upstream: [2].

Even though support for draft worklfow was removed, the drafts magic
draft option was preserved, and is mapped to creation of the private
change when pushed first time, or creation of change edit on subsequent
pushes. These behaviour was alaways controvesial, but was kept in place
because 2 major Gerrit clients: repo and git-review were still
referencing drafts magic branch. In upcoming gerrit releases the support
for drafts magic branch option is discontinued, and thus removed from
both repo and git-review: [3].

[1] https://gerrit-review.googlesource.com/c/gerrit/+/97230
[2] https://crbug.com/gerrit/6880
[3] https://gerrit-review.googlesource.com/c/gerrit/+/238898

Sem-Ver: api-break
Change-Id: I08a590d42e1ebaa230da960cd192c0b1df528332
  • Loading branch information
davido authored and dpursehouse committed Jan 17, 2020
1 parent 5afa906 commit 02491ca
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
2 changes: 0 additions & 2 deletions doc/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,5 @@ The name of the script is $action-review where action can be:

* post - run at the end after the review was sent.

* draft - run when in draft mode.

If the script returns with an exit status different than zero, git-review will
exit with the custom shell exit code ``71``.
4 changes: 1 addition & 3 deletions git-review.1
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,6 @@ Indicate that you do, in fact, understand if you are submitting more than
one patch.
.It Fl v , Fl \-verbose
Turns on more verbose output.
.It Fl D , Fl \-draft
Submit review as a draft. Requires Gerrit 2.3 or newer.
.It Fl R , Fl \-no\-rebase
Do not automatically perform a rebase before submitting the change to
Gerrit.
Expand All @@ -178,7 +176,7 @@ Enable or disable a color output. Default is "auto".
Same thing as \-\-color=never.
.It Fl \-no\-custom\-script
Do not run scripts, installed as hooks/{action}-review, where action
is one of "pre", "draft", or "post".
is one of "pre" or "post".
.It Fl \-track
Choose the branch to submit the change against (and, if
rebasing, to rebase against) from the branch being tracked
Expand Down
8 changes: 0 additions & 8 deletions git_review/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1423,8 +1423,6 @@ def _main():

parser.add_argument("--reviewers", nargs="+",
help="Add reviewers to uploaded patch sets.")
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",
help="Don't actually submit the branch for review")
parser.add_argument("-i", "--new-changeid", dest="regenerate",
Expand Down Expand Up @@ -1553,7 +1551,6 @@ def _main():
parser.add_argument("branch", nargs="?")

parser.set_defaults(dry=False,
draft=False,
verbose=False,
update=False,
setup=False,
Expand Down Expand Up @@ -1661,11 +1658,6 @@ def _main():

ref = "for"

if options.draft:
ref = "drafts"
if options.custom_script:
run_custom_script("draft")

cmd = ("git push --no-follow-tags %s HEAD:refs/%s/%s" %
(remote, ref, branch))
push_options = []
Expand Down

0 comments on commit 02491ca

Please sign in to comment.