git-cl: only set WIP on first upload

It seems like some folks are confused by additional patchsets
after the first putting the change back into WIP mode. This
confusion is honestly understandable. Maybe we try only setting
it on the very first upload, and just controlling the notify
parameter for future patchsets.

Bug: 721836, 737675
Change-Id: If56e5c71e0c6b3b46c2e30ac0b6d80b878218181
Reviewed-on: https://chromium-review.googlesource.com/552779
Reviewed-by: Quinten Yearsley <qyearsley@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: smut <smut@google.com>
Commit-Queue: Aaron Gable <agable@chromium.org>
changes/79/552779/4
Aaron Gable 8 years ago committed by Commit Bot
parent c833946a1f
commit 844cf2963b

@ -3016,10 +3016,17 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase):
# https://gerrit-review.googlesource.com/Documentation/user-upload.html
refspec_opts = []
# By default, new changes are started in WIP mode, and subsequent patchsets
# don't send email. At any time, passing --send-mail will mark the change
# ready and send email for that particular patch.
if options.send_mail:
refspec_opts.append('ready')
refspec_opts.append('notify=ALL')
else:
refspec_opts.append('wip')
if not self.GetIssue():
refspec_opts.append('wip')
else:
refspec_opts.append('notify=NONE')
# 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.

@ -1519,9 +1519,13 @@ class TestGitCl(TestCase):
'1hashPerLine\n'),
]
ref_suffix = '%wip'
if notify:
ref_suffix = '%ready'
ref_suffix = '%ready,notify=ALL'
else:
if not issue:
ref_suffix = '%wip'
else:
ref_suffix = '%notify=NONE'
if title:
ref_suffix += ',m=' + title

Loading…
Cancel
Save