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.""" | 8 """A git-command for integrating reviews on Rietveld.""" |
9 | 9 |
10 from distutils.version import LooseVersion | 10 from distutils.version import LooseVersion |
(...skipping 2015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2026 if viewvc_url and revision: | 2026 if viewvc_url and revision: |
2027 change_desc.append_footer('Committed: ' + viewvc_url + revision) | 2027 change_desc.append_footer('Committed: ' + viewvc_url + revision) |
2028 elif revision: | 2028 elif revision: |
2029 change_desc.append_footer('Committed: ' + revision) | 2029 change_desc.append_footer('Committed: ' + revision) |
2030 print ('Closing issue ' | 2030 print ('Closing issue ' |
2031 '(you may be prompted for your codereview password)...') | 2031 '(you may be prompted for your codereview password)...') |
2032 cl.UpdateDescription(change_desc.description) | 2032 cl.UpdateDescription(change_desc.description) |
2033 cl.CloseIssue() | 2033 cl.CloseIssue() |
2034 props = cl.GetIssueProperties() | 2034 props = cl.GetIssueProperties() |
2035 patch_num = len(props['patchsets']) | 2035 patch_num = len(props['patchsets']) |
2036 comment = "Committed patchset #%d manually as r%s" % (patch_num, revision) | 2036 comment = "Committed patchset #%d manually as %s" % (patch_num, revision) |
2037 if options.bypass_hooks: | 2037 if options.bypass_hooks: |
2038 comment += ' (tree was closed).' if GetTreeStatus() == 'closed' else '.' | 2038 comment += ' (tree was closed).' if GetTreeStatus() == 'closed' else '.' |
2039 else: | 2039 else: |
2040 comment += ' (presubmit successful).' | 2040 comment += ' (presubmit successful).' |
2041 cl.RpcServer().add_comment(cl.GetIssue(), comment) | 2041 cl.RpcServer().add_comment(cl.GetIssue(), comment) |
2042 cl.SetIssue(None) | 2042 cl.SetIssue(None) |
2043 | 2043 |
2044 if retcode == 0: | 2044 if retcode == 0: |
2045 hook = POSTUPSTREAM_HOOK_PATTERN % cmd | 2045 hook = POSTUPSTREAM_HOOK_PATTERN % cmd |
2046 if os.path.isfile(hook): | 2046 if os.path.isfile(hook): |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2633 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' | 2633 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' |
2634 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 2634 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
2635 | 2635 |
2636 | 2636 |
2637 if __name__ == '__main__': | 2637 if __name__ == '__main__': |
2638 # These affect sys.stdout so do it outside of main() to simplify mocks in | 2638 # These affect sys.stdout so do it outside of main() to simplify mocks in |
2639 # unit testing. | 2639 # unit testing. |
2640 fix_encoding.fix_encoding() | 2640 fix_encoding.fix_encoding() |
2641 colorama.init() | 2641 colorama.init() |
2642 sys.exit(main(sys.argv[1:])) | 2642 sys.exit(main(sys.argv[1:])) |
OLD | NEW |