diff --git a/git_cl.py b/git_cl.py index 4513d9559..1fc3139bb 100755 --- a/git_cl.py +++ b/git_cl.py @@ -3122,6 +3122,19 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase): change_desc.update_reviewers(options.reviewers, options.tbrs, options.add_owners_to, change) + # TODO(tandrii): process reviewers and ccs into refspec. + reviewers = sorted(change_desc.get_reviewers()) + # Add cc's from the CC_LIST and --cc flag (if any). + if not options.private and not options.no_autocc: + cc = self.GetCCList().split(',') + else: + cc = [] + if options.cc: + cc.extend(options.cc) + cc = filter(None, [email.strip() for email in cc]) + if change_desc.get_cced(): + cc.extend(change_desc.get_cced()) + # Extra options that can be specified at push time. Doc: # https://gerrit-review.googlesource.com/Documentation/user-upload.html refspec_opts = [] @@ -3247,19 +3260,6 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase): self.SetIssue(change_numbers[0]) self._GitSetBranchConfigValue('gerritsquashhash', ref_to_push) - reviewers = sorted(change_desc.get_reviewers()) - - # Add cc's from the CC_LIST and --cc flag (if any). - if not options.private and not options.no_autocc: - cc = self.GetCCList().split(',') - else: - cc = [] - if options.cc: - cc.extend(options.cc) - cc = filter(None, [email.strip() for email in cc]) - if change_desc.get_cced(): - cc.extend(change_desc.get_cced()) - if self.GetIssue(): # GetIssue() is not set in case of non-squash uploads according to tests. # TODO(agable): non-squash uploads in git cl should be removed. diff --git a/tests/git_cl_test.py b/tests/git_cl_test.py index 60fc3c8ba..b198f7cce 100755 --- a/tests/git_cl_test.py +++ b/tests/git_cl_test.py @@ -1261,6 +1261,10 @@ class TestGitCl(TestCase): if title: ref_suffix += ',m=' + title + calls += [ + ((['git', 'config', 'rietveld.cc'],), ''), + ] + calls.append(( (['git', 'push', 'https://chromium.googlesource.com/my/repo', @@ -1289,9 +1293,6 @@ class TestGitCl(TestCase): ((['git', 'config', 'branch.master.gerritsquashhash', 'abcdef0123456789'],), ''), ] - calls += [ - ((['git', 'config', 'rietveld.cc'],), ''), - ] if squash: calls += [ (('AddReviewers',