OLD | NEW |
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 Loading... |
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 Loading... |
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) |
OLD | NEW |