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 22 matching lines...) Expand all Loading... |
33 try: | 33 try: |
34 import readline # pylint: disable=F0401,W0611 | 34 import readline # pylint: disable=F0401,W0611 |
35 except ImportError: | 35 except ImportError: |
36 pass | 36 pass |
37 | 37 |
38 from third_party import colorama | 38 from third_party import colorama |
39 from third_party import httplib2 | 39 from third_party import httplib2 |
40 from third_party import upload | 40 from third_party import upload |
41 import auth | 41 import auth |
42 from luci_hacks import trigger_luci_job as luci_trigger | 42 from luci_hacks import trigger_luci_job as luci_trigger |
43 import breakpad # pylint: disable=W0611 | |
44 import clang_format | 43 import clang_format |
45 import commit_queue | 44 import commit_queue |
46 import dart_format | 45 import dart_format |
47 import fix_encoding | 46 import fix_encoding |
48 import gclient_utils | 47 import gclient_utils |
49 import git_common | 48 import git_common |
50 from git_footers import get_footer_svn_id | 49 from git_footers import get_footer_svn_id |
51 import owners | 50 import owners |
52 import owners_finder | 51 import owners_finder |
53 import presubmit_support | 52 import presubmit_support |
(...skipping 2558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2612 # Check the tree status if the tree status URL is set. | 2611 # Check the tree status if the tree status URL is set. |
2613 status = GetTreeStatus() | 2612 status = GetTreeStatus() |
2614 if 'closed' == status: | 2613 if 'closed' == status: |
2615 print('The tree is closed. Please wait for it to reopen. Use ' | 2614 print('The tree is closed. Please wait for it to reopen. Use ' |
2616 '"git cl %s --bypass-hooks" to commit on a closed tree.' % cmd) | 2615 '"git cl %s --bypass-hooks" to commit on a closed tree.' % cmd) |
2617 return 1 | 2616 return 1 |
2618 elif 'unknown' == status: | 2617 elif 'unknown' == status: |
2619 print('Unable to determine tree status. Please verify manually and ' | 2618 print('Unable to determine tree status. Please verify manually and ' |
2620 'use "git cl %s --bypass-hooks" to commit on a closed tree.' % cmd) | 2619 'use "git cl %s --bypass-hooks" to commit on a closed tree.' % cmd) |
2621 return 1 | 2620 return 1 |
2622 else: | |
2623 breakpad.SendStack( | |
2624 'GitClHooksBypassedCommit', | |
2625 'Issue %s/%s bypassed hook when committing (tree status was "%s")' % | |
2626 (cl.GetRietveldServer(), cl.GetIssue(), GetTreeStatus()), | |
2627 verbose=False) | |
2628 | 2621 |
2629 change_desc = ChangeDescription(options.message) | 2622 change_desc = ChangeDescription(options.message) |
2630 if not change_desc.description and cl.GetIssue(): | 2623 if not change_desc.description and cl.GetIssue(): |
2631 change_desc = ChangeDescription(cl.GetDescription()) | 2624 change_desc = ChangeDescription(cl.GetDescription()) |
2632 | 2625 |
2633 if not change_desc.description: | 2626 if not change_desc.description: |
2634 if not cl.GetIssue() and options.bypass_hooks: | 2627 if not cl.GetIssue() and options.bypass_hooks: |
2635 change_desc = ChangeDescription(CreateDescriptionFromLog([merge_base])) | 2628 change_desc = ChangeDescription(CreateDescriptionFromLog([merge_base])) |
2636 else: | 2629 else: |
2637 print 'No description set.' | 2630 print 'No description set.' |
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3766 if __name__ == '__main__': | 3759 if __name__ == '__main__': |
3767 # These affect sys.stdout so do it outside of main() to simplify mocks in | 3760 # These affect sys.stdout so do it outside of main() to simplify mocks in |
3768 # unit testing. | 3761 # unit testing. |
3769 fix_encoding.fix_encoding() | 3762 fix_encoding.fix_encoding() |
3770 colorama.init() | 3763 colorama.init() |
3771 try: | 3764 try: |
3772 sys.exit(main(sys.argv[1:])) | 3765 sys.exit(main(sys.argv[1:])) |
3773 except KeyboardInterrupt: | 3766 except KeyboardInterrupt: |
3774 sys.stderr.write('interrupted\n') | 3767 sys.stderr.write('interrupted\n') |
3775 sys.exit(1) | 3768 sys.exit(1) |
OLD | NEW |