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 """\ | 6 """\ |
7 Wrapper script around Rietveld's upload.py that simplifies working with groups | 7 Wrapper script around Rietveld's upload.py that simplifies working with groups |
8 of files. | 8 of files. |
9 """ | 9 """ |
10 | 10 |
11 import json | 11 import json |
12 import optparse | 12 import optparse |
13 import os | 13 import os |
14 import random | 14 import random |
15 import re | 15 import re |
16 import ssl | 16 import ssl |
17 import string | 17 import string |
18 import sys | 18 import sys |
19 import tempfile | 19 import tempfile |
20 import time | 20 import time |
21 import urllib2 | 21 import urllib2 |
22 | 22 |
| 23 import breakpad # pylint: disable=W0611 |
| 24 |
23 | 25 |
24 import auth | 26 import auth |
25 import fix_encoding | 27 import fix_encoding |
26 import gclient_utils | 28 import gclient_utils |
27 import git_cl | 29 import git_cl |
28 import presubmit_support | 30 import presubmit_support |
29 import rietveld | 31 import rietveld |
30 from scm import SVN | 32 from scm import SVN |
31 import subprocess2 | 33 import subprocess2 |
32 from third_party import upload | 34 from third_party import upload |
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 files, GetRepositoryRoot(), full_move=False, revision=None) | 736 files, GetRepositoryRoot(), full_move=False, revision=None) |
735 | 737 |
736 | 738 |
737 def GetTreeStatus(): | 739 def GetTreeStatus(): |
738 tree_status_url = GetCodeReviewSetting('STATUS') | 740 tree_status_url = GetCodeReviewSetting('STATUS') |
739 return git_cl.GetTreeStatus(tree_status_url) if tree_status_url else "unset" | 741 return git_cl.GetTreeStatus(tree_status_url) if tree_status_url else "unset" |
740 | 742 |
741 | 743 |
742 def OptionallyDoPresubmitChecks(change_info, committing, args): | 744 def OptionallyDoPresubmitChecks(change_info, committing, args): |
743 if FilterFlag(args, "--no_presubmit") or FilterFlag(args, "--force"): | 745 if FilterFlag(args, "--no_presubmit") or FilterFlag(args, "--force"): |
| 746 breakpad.SendStack( |
| 747 breakpad.DEFAULT_URL + '/breakpad', |
| 748 'GclHooksBypassedCommit', |
| 749 'Issue %s/%s bypassed hook when committing (tree status was "%s")' % |
| 750 (change_info.rietveld, change_info.issue, GetTreeStatus()), |
| 751 verbose=False) |
744 return presubmit_support.PresubmitOutput() | 752 return presubmit_support.PresubmitOutput() |
745 return DoPresubmitChecks(change_info, committing, True) | 753 return DoPresubmitChecks(change_info, committing, True) |
746 | 754 |
747 | 755 |
748 def defer_attributes(a, b): | 756 def defer_attributes(a, b): |
749 """Copy attributes from an object (like a function) to another.""" | 757 """Copy attributes from an object (like a function) to another.""" |
750 for x in dir(a): | 758 for x in dir(a): |
751 if not getattr(b, x, None): | 759 if not getattr(b, x, None): |
752 setattr(b, x, getattr(a, x)) | 760 setattr(b, x, getattr(a, x)) |
753 | 761 |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1514 return 1 | 1522 return 1 |
1515 | 1523 |
1516 | 1524 |
1517 if __name__ == "__main__": | 1525 if __name__ == "__main__": |
1518 fix_encoding.fix_encoding() | 1526 fix_encoding.fix_encoding() |
1519 try: | 1527 try: |
1520 sys.exit(main(sys.argv[1:])) | 1528 sys.exit(main(sys.argv[1:])) |
1521 except KeyboardInterrupt: | 1529 except KeyboardInterrupt: |
1522 sys.stderr.write('interrupted\n') | 1530 sys.stderr.write('interrupted\n') |
1523 sys.exit(1) | 1531 sys.exit(1) |
OLD | NEW |