From 0b2d70724f1319bf251e14d4c223f2dd7fc2090d Mon Sep 17 00:00:00 2001 From: "tandrii@chromium.org" Date: Mon, 18 Apr 2016 16:19:03 +0000 Subject: [PATCH] Gerrit git cl: temporary disable cc option on upload. Gerrit doesn't allow arbitrary non-member emails for now, thus removign this feature until either Gerrit allows it, or we have a per-repo opt-in way. TBR=andybons@chromium.org BUG=604377 Review URL: https://codereview.chromium.org/1895863002 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299988 0039d316-1c4b-4281-b951-d872f2087c98 --- git_cl.py | 5 ++++- tests/git_cl_test.py | 16 ++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/git_cl.py b/git_cl.py index cf1e2c910..d8fd64224 100755 --- a/git_cl.py +++ b/git_cl.py @@ -2453,7 +2453,10 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase): cc.extend(options.cc) cc = filter(None, cc) if cc: - refspec_opts.extend('cc=' + email.strip() for email in cc) + # refspec_opts.extend('cc=' + email.strip() for email in cc) + # TODO(tandrii): enable this back. http://crbug.com/604377 + print('WARNING: Gerrit doesn\'t yet support cc-ing arbitrary emails.\n' + ' Ignoring cc-ed emails. See http://crbug.com/604377.') if change_desc.get_reviewers(): refspec_opts.extend('r=' + email.strip() diff --git a/tests/git_cl_test.py b/tests/git_cl_test.py index a78c7383c..8b00ac7e1 100755 --- a/tests/git_cl_test.py +++ b/tests/git_cl_test.py @@ -809,13 +809,17 @@ class TestGitCl(TestCase): ((['git', 'config', 'rietveld.cc'],), '') ] # Add cc from watch list. - if ref_suffix == '': - ref_suffix = '%cc=joe@example.com' - else: - ref_suffix += ',cc=joe@example.com' + # TODO(tandrii): bring this back after http://crbug.com/604377. + # if ref_suffix == '': + # ref_suffix = '%cc=joe@example.com' + # else: + # ref_suffix += ',cc=joe@example.com' if reviewers: - ref_suffix += ',' + ','.join('r=%s' % email - for email in sorted(reviewers)) + if ref_suffix: + ref_suffix += ',' + else: + ref_suffix = '%' + ref_suffix += ','.join('r=%s' % email for email in sorted(reviewers)) calls += [ ((['git', 'push', 'origin', ref_to_push + ':refs/for/refs/heads/master' + ref_suffix],),