Commit 4d843595 authored by tandrii's avatar tandrii Committed by Commit bot

git cl set-commit: fix for Rietveld if cq dry run is active.

If dry-run was active, git cl set-commit didn't actually trigger a
full CQ run, but was just a no-op.

TBR=machenbach@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2184643004
parent 1278dbd1
......@@ -1799,7 +1799,7 @@ class _RietveldChangelistImpl(_ChangelistCodereviewBase):
DieWithError('Cannot set-commit on private issue')
if new_state == _CQState.COMMIT:
self.SetFlag('commit', '1')
self.SetFlags({'commit': '1', 'cq_dry_run': '0'})
elif new_state == _CQState.NONE:
self.SetFlags({'commit': '0', 'cq_dry_run': '0'})
else:
......
......@@ -1466,8 +1466,8 @@ class TestGitCl(TestCase):
self.assertIsNone(cl.EnsureAuthenticated(force=False))
def test_cmd_set_commit_rietveld(self):
self.mock(git_cl._RietveldChangelistImpl, 'SetFlag',
lambda _, f, v: self._mocked_call(['SetFlag', f, v]))
self.mock(git_cl._RietveldChangelistImpl, 'SetFlags',
lambda _, v: self._mocked_call(['SetFlags', v]))
self.calls = [
((['git', 'symbolic-ref', 'HEAD'],), 'feature'),
((['git', 'config', 'branch.feature.rietveldissue'],), '123'),
......@@ -1476,7 +1476,7 @@ class TestGitCl(TestCase):
((['git', 'config', 'rietveld.server'],), ''),
((['git', 'config', 'branch.feature.rietveldserver'],),
'https://codereview.chromium.org'),
((['SetFlag', 'commit', '1'], ), ''),
((['SetFlags', {'commit': '1', 'cq_dry_run': '0'}], ), ''),
]
self.assertEqual(0, git_cl.main(['set-commit']))
......
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