Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Side by Side Diff: git_cl.py

Issue 2184643004: git cl set-commit: fix for Rietveld if cq dry run is active. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tests/git_cl_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 # Copyright (C) 2008 Evan Martin <martine@danga.com> 6 # Copyright (C) 2008 Evan Martin <martine@danga.com>
7 7
8 """A git-command for integrating reviews on Rietveld and Gerrit.""" 8 """A git-command for integrating reviews on Rietveld and Gerrit."""
9 9
10 from __future__ import print_function 10 from __future__ import print_function
(...skipping 1781 matching lines...) Expand 10 before | Expand all | Expand 10 after
1792 1792
1793 def GetRieveldObjForPresubmit(self): 1793 def GetRieveldObjForPresubmit(self):
1794 return self.RpcServer() 1794 return self.RpcServer()
1795 1795
1796 def SetCQState(self, new_state): 1796 def SetCQState(self, new_state):
1797 props = self.GetIssueProperties() 1797 props = self.GetIssueProperties()
1798 if props.get('private'): 1798 if props.get('private'):
1799 DieWithError('Cannot set-commit on private issue') 1799 DieWithError('Cannot set-commit on private issue')
1800 1800
1801 if new_state == _CQState.COMMIT: 1801 if new_state == _CQState.COMMIT:
1802 self.SetFlag('commit', '1') 1802 self.SetFlags({'commit': '1', 'cq_dry_run': '0'})
1803 elif new_state == _CQState.NONE: 1803 elif new_state == _CQState.NONE:
1804 self.SetFlags({'commit': '0', 'cq_dry_run': '0'}) 1804 self.SetFlags({'commit': '0', 'cq_dry_run': '0'})
1805 else: 1805 else:
1806 assert new_state == _CQState.DRY_RUN 1806 assert new_state == _CQState.DRY_RUN
1807 self.SetFlags({'commit': '1', 'cq_dry_run': '1'}) 1807 self.SetFlags({'commit': '1', 'cq_dry_run': '1'})
1808 1808
1809 1809
1810 def CMDPatchWithParsedIssue(self, parsed_issue_arg, reject, nocommit, 1810 def CMDPatchWithParsedIssue(self, parsed_issue_arg, reject, nocommit,
1811 directory): 1811 directory):
1812 # TODO(maruel): Use apply_issue.py 1812 # TODO(maruel): Use apply_issue.py
(...skipping 3291 matching lines...) Expand 10 before | Expand all | Expand 10 after
5104 if __name__ == '__main__': 5104 if __name__ == '__main__':
5105 # These affect sys.stdout so do it outside of main() to simplify mocks in 5105 # These affect sys.stdout so do it outside of main() to simplify mocks in
5106 # unit testing. 5106 # unit testing.
5107 fix_encoding.fix_encoding() 5107 fix_encoding.fix_encoding()
5108 setup_color.init() 5108 setup_color.init()
5109 try: 5109 try:
5110 sys.exit(main(sys.argv[1:])) 5110 sys.exit(main(sys.argv[1:]))
5111 except KeyboardInterrupt: 5111 except KeyboardInterrupt:
5112 sys.stderr.write('interrupted\n') 5112 sys.stderr.write('interrupted\n')
5113 sys.exit(1) 5113 sys.exit(1)
OLDNEW
« no previous file with comments | « no previous file | tests/git_cl_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698