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