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 4079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4090 cl.CloseIssue() | 4090 cl.CloseIssue() |
4091 props = cl.GetIssueProperties() | 4091 props = cl.GetIssueProperties() |
4092 patch_num = len(props['patchsets']) | 4092 patch_num = len(props['patchsets']) |
4093 comment = "Committed patchset #%d (id:%d)%s manually as %s" % ( | 4093 comment = "Committed patchset #%d (id:%d)%s manually as %s" % ( |
4094 patch_num, props['patchsets'][-1], to_pending, revision) | 4094 patch_num, props['patchsets'][-1], to_pending, revision) |
4095 if options.bypass_hooks: | 4095 if options.bypass_hooks: |
4096 comment += ' (tree was closed).' if GetTreeStatus() == 'closed' else '.' | 4096 comment += ' (tree was closed).' if GetTreeStatus() == 'closed' else '.' |
4097 else: | 4097 else: |
4098 comment += ' (presubmit successful).' | 4098 comment += ' (presubmit successful).' |
4099 cl.RpcServer().add_comment(cl.GetIssue(), comment) | 4099 cl.RpcServer().add_comment(cl.GetIssue(), comment) |
4100 cl.SetIssue(None) | |
4101 | 4100 |
4102 if pushed_to_pending: | 4101 if pushed_to_pending: |
4103 _, branch = cl.FetchUpstreamTuple(cl.GetBranch()) | 4102 _, branch = cl.FetchUpstreamTuple(cl.GetBranch()) |
4104 print('The commit is in the pending queue (%s).' % pending_ref) | 4103 print('The commit is in the pending queue (%s).' % pending_ref) |
4105 print('It will show up on %s in ~1 min, once it gets a Cr-Commit-Position ' | 4104 print('It will show up on %s in ~1 min, once it gets a Cr-Commit-Position ' |
4106 'footer.' % branch) | 4105 'footer.' % branch) |
4107 | 4106 |
4108 hook = POSTUPSTREAM_HOOK_PATTERN % cmd | 4107 hook = POSTUPSTREAM_HOOK_PATTERN % cmd |
4109 if os.path.isfile(hook): | 4108 if os.path.isfile(hook): |
4110 RunCommand([hook, merge_base], error_ok=True) | 4109 RunCommand([hook, merge_base], error_ok=True) |
(...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5079 if __name__ == '__main__': | 5078 if __name__ == '__main__': |
5080 # These affect sys.stdout so do it outside of main() to simplify mocks in | 5079 # These affect sys.stdout so do it outside of main() to simplify mocks in |
5081 # unit testing. | 5080 # unit testing. |
5082 fix_encoding.fix_encoding() | 5081 fix_encoding.fix_encoding() |
5083 setup_color.init() | 5082 setup_color.init() |
5084 try: | 5083 try: |
5085 sys.exit(main(sys.argv[1:])) | 5084 sys.exit(main(sys.argv[1:])) |
5086 except KeyboardInterrupt: | 5085 except KeyboardInterrupt: |
5087 sys.stderr.write('interrupted\n') | 5086 sys.stderr.write('interrupted\n') |
5088 sys.exit(1) | 5087 sys.exit(1) |
OLD | NEW |