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 2072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2083 comment += ' (tree was closed).' if GetTreeStatus() == 'closed' else '.' | 2083 comment += ' (tree was closed).' if GetTreeStatus() == 'closed' else '.' |
2084 else: | 2084 else: |
2085 comment += ' (presubmit successful).' | 2085 comment += ' (presubmit successful).' |
2086 cl.RpcServer().add_comment(cl.GetIssue(), comment) | 2086 cl.RpcServer().add_comment(cl.GetIssue(), comment) |
2087 cl.SetIssue(None) | 2087 cl.SetIssue(None) |
2088 | 2088 |
2089 if pushed_to_pending: | 2089 if pushed_to_pending: |
2090 _, branch = cl.FetchUpstreamTuple(cl.GetBranch()) | 2090 _, branch = cl.FetchUpstreamTuple(cl.GetBranch()) |
2091 print 'The commit is in the pending queue (%s).' % pending_ref | 2091 print 'The commit is in the pending queue (%s).' % pending_ref |
2092 print ( | 2092 print ( |
2093 'It will show up on %s in ~1 min, once it gets Cr-Commit-Position ' | 2093 'It will show up on %s in ~1 min, once it gets a Cr-Commit-Position ' |
2094 'footer.' % branch) | 2094 'footer.' % branch) |
2095 | 2095 |
2096 hook = POSTUPSTREAM_HOOK_PATTERN % cmd | 2096 hook = POSTUPSTREAM_HOOK_PATTERN % cmd |
2097 if os.path.isfile(hook): | 2097 if os.path.isfile(hook): |
2098 RunCommand([hook, merge_base], error_ok=True) | 2098 RunCommand([hook, merge_base], error_ok=True) |
2099 | 2099 |
2100 return 1 if killed else 0 | 2100 return 1 if killed else 0 |
2101 | 2101 |
2102 | 2102 |
2103 def WaitForRealCommit(remote, pushed_commit, local_base_ref, real_ref): | 2103 def WaitForRealCommit(remote, pushed_commit, local_base_ref, real_ref): |
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2813 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' | 2813 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' |
2814 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 2814 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
2815 | 2815 |
2816 | 2816 |
2817 if __name__ == '__main__': | 2817 if __name__ == '__main__': |
2818 # These affect sys.stdout so do it outside of main() to simplify mocks in | 2818 # These affect sys.stdout so do it outside of main() to simplify mocks in |
2819 # unit testing. | 2819 # unit testing. |
2820 fix_encoding.fix_encoding() | 2820 fix_encoding.fix_encoding() |
2821 colorama.init() | 2821 colorama.init() |
2822 sys.exit(main(sys.argv[1:])) | 2822 sys.exit(main(sys.argv[1:])) |
OLD | NEW |