From afd527777845559fe305399a362702f2e2d7e4ab Mon Sep 17 00:00:00 2001 From: Aaron Gable Date: Tue, 27 Jun 2017 16:40:10 -0700 Subject: [PATCH] git-cl-upload: make it possible to exit WIP mode The previous CL forgot that the lack of '%wip' doesn't mark a change ready-to-review, you have to explicitly pass '%ready' in the refspec to do that. TBR=tandrii@chromium.org Bug: 721836 Change-Id: Iea82222d64edf1b73fefa9bca3feec4188e35ab3 Reviewed-on: https://chromium-review.googlesource.com/551005 Reviewed-by: Aaron Gable Commit-Queue: Aaron Gable --- git_cl.py | 4 +++- tests/git_cl_test.py | 11 ++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/git_cl.py b/git_cl.py index 213ff9180e..5b945b90e8 100755 --- a/git_cl.py +++ b/git_cl.py @@ -3016,7 +3016,9 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase): # https://gerrit-review.googlesource.com/Documentation/user-upload.html refspec_opts = [] - if not options.send_mail: + if options.send_mail: + refspec_opts.append('ready') + else: refspec_opts.append('wip') # TODO(tandrii): options.message should be posted as a comment diff --git a/tests/git_cl_test.py b/tests/git_cl_test.py index d7938db72d..b1c5f7c6f5 100755 --- a/tests/git_cl_test.py +++ b/tests/git_cl_test.py @@ -1519,15 +1519,12 @@ class TestGitCl(TestCase): '1hashPerLine\n'), ] - ref_suffix = '' - if not notify: - ref_suffix = '%wip' + ref_suffix = '%wip' + if notify: + ref_suffix = '%ready' if title: - if ref_suffix: - ref_suffix += ',m=' + title - else: - ref_suffix = '%m=' + title + ref_suffix += ',m=' + title if git_mirror is None: calls += [