Commit 70f4e24d authored by Aaron Gable's avatar Aaron Gable Committed by Commit Bot

git-cl: upload changes in WIP unless --send-mail

Work-In-Progress is a new change flag that can be set on
Gerrit changes. While a change is in WIP mode, certain things
are different:
* It doesn't send emails except to the change owner
* The "Reply" button becomes "Start Review"
* When a change is moved out of WIP, it sends a special
  "ready for review" message to any new reviewers
This is much more similar to the Rietveld model, where users
would "Publish" their changes for the reviewers to look at.

Bug: 721836
Change-Id: I3b9697e311fa176cb679ecefbfead9bb32b6afaf
Reviewed-on: https://chromium-review.googlesource.com/549015Reviewed-by: 's avatarAndrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: 's avatarQuinten Yearsley <qyearsley@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
parent c881b9db
......@@ -3012,14 +3012,13 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase):
change_desc.update_reviewers(options.reviewers, options.tbrs,
options.add_owners_to, change)
if options.send_mail:
if not change_desc.get_reviewers():
DieWithError('Must specify reviewers to send email.', change_desc)
# Extra options that can be specified at push time. Doc:
# https://gerrit-review.googlesource.com/Documentation/user-upload.html
refspec_opts = []
if not options.send_mail:
refspec_opts.append('wip')
# TODO(tandrii): options.message should be posted as a comment
# if --send-email is set on non-initial upload as Rietveld used to do it.
......@@ -3035,10 +3034,6 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase):
# reverse on its side.
refspec_opts.append('m=' + title.replace(' ', '_'))
# Never notify now because no one is on the review. Notify when we add
# reviewers and CCs below.
refspec_opts.append('notify=NONE')
if options.private:
refspec_opts.append('private')
......
......@@ -1520,14 +1520,14 @@ class TestGitCl(TestCase):
]
ref_suffix = ''
if title:
ref_suffix += '%m=' + title
if not notify:
ref_suffix = '%wip'
notify_suffix = 'notify=NONE'
if ref_suffix:
ref_suffix += ',' + notify_suffix
else:
ref_suffix = '%' + notify_suffix
if title:
if ref_suffix:
ref_suffix += ',m=' + title
else:
ref_suffix = '%m=' + title
if git_mirror is None:
calls += [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment