| 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 2035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2046 change_desc.append_footer( | 2046 change_desc.append_footer( |
| 2047 'Committed%s: %s%s' % (to_pending, viewvc_url, revision)) | 2047 'Committed%s: %s%s' % (to_pending, viewvc_url, revision)) |
| 2048 elif revision: | 2048 elif revision: |
| 2049 change_desc.append_footer('Committed%s: %s' % (to_pending, revision)) | 2049 change_desc.append_footer('Committed%s: %s' % (to_pending, revision)) |
| 2050 print ('Closing issue ' | 2050 print ('Closing issue ' |
| 2051 '(you may be prompted for your codereview password)...') | 2051 '(you may be prompted for your codereview password)...') |
| 2052 cl.UpdateDescription(change_desc.description) | 2052 cl.UpdateDescription(change_desc.description) |
| 2053 cl.CloseIssue() | 2053 cl.CloseIssue() |
| 2054 props = cl.GetIssueProperties() | 2054 props = cl.GetIssueProperties() |
| 2055 patch_num = len(props['patchsets']) | 2055 patch_num = len(props['patchsets']) |
| 2056 comment = "Committed patchset #%d%s manually as %s" % ( | 2056 comment = "Committed patchset #%d (id:%d)%s manually as %s" % ( |
| 2057 patch_num, to_pending, revision) | 2057 patch_num, props['patchsets'][-1], to_pending, revision) |
| 2058 if options.bypass_hooks: | 2058 if options.bypass_hooks: |
| 2059 comment += ' (tree was closed).' if GetTreeStatus() == 'closed' else '.' | 2059 comment += ' (tree was closed).' if GetTreeStatus() == 'closed' else '.' |
| 2060 else: | 2060 else: |
| 2061 comment += ' (presubmit successful).' | 2061 comment += ' (presubmit successful).' |
| 2062 cl.RpcServer().add_comment(cl.GetIssue(), comment) | 2062 cl.RpcServer().add_comment(cl.GetIssue(), comment) |
| 2063 cl.SetIssue(None) | 2063 cl.SetIssue(None) |
| 2064 | 2064 |
| 2065 if used_pending and retcode == 0: | 2065 if used_pending and retcode == 0: |
| 2066 _, branch = cl.FetchUpstreamTuple(cl.GetBranch()) | 2066 _, branch = cl.FetchUpstreamTuple(cl.GetBranch()) |
| 2067 print 'The commit is in the pending queue (%s).' % pending_ref | 2067 print 'The commit is in the pending queue (%s).' % pending_ref |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2765 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' | 2765 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' |
| 2766 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 2766 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
| 2767 | 2767 |
| 2768 | 2768 |
| 2769 if __name__ == '__main__': | 2769 if __name__ == '__main__': |
| 2770 # These affect sys.stdout so do it outside of main() to simplify mocks in | 2770 # These affect sys.stdout so do it outside of main() to simplify mocks in |
| 2771 # unit testing. | 2771 # unit testing. |
| 2772 fix_encoding.fix_encoding() | 2772 fix_encoding.fix_encoding() |
| 2773 colorama.init() | 2773 colorama.init() |
| 2774 sys.exit(main(sys.argv[1:])) | 2774 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |