| 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 | |
| 25 | 23 |
| 26 import auth | 24 import auth |
| 27 import fix_encoding | 25 import fix_encoding |
| 28 import gclient_utils | 26 import gclient_utils |
| 29 import git_cl | 27 import git_cl |
| 30 import presubmit_support | 28 import presubmit_support |
| 31 import rietveld | 29 import rietveld |
| 32 from scm import SVN | 30 from scm import SVN |
| 33 import subprocess2 | 31 import subprocess2 |
| 34 from third_party import upload | 32 from third_party import upload |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 files, GetRepositoryRoot(), full_move=False, revision=None) | 734 files, GetRepositoryRoot(), full_move=False, revision=None) |
| 737 | 735 |
| 738 | 736 |
| 739 def GetTreeStatus(): | 737 def GetTreeStatus(): |
| 740 tree_status_url = GetCodeReviewSetting('STATUS') | 738 tree_status_url = GetCodeReviewSetting('STATUS') |
| 741 return git_cl.GetTreeStatus(tree_status_url) if tree_status_url else "unset" | 739 return git_cl.GetTreeStatus(tree_status_url) if tree_status_url else "unset" |
| 742 | 740 |
| 743 | 741 |
| 744 def OptionallyDoPresubmitChecks(change_info, committing, args): | 742 def OptionallyDoPresubmitChecks(change_info, committing, args): |
| 745 if FilterFlag(args, "--no_presubmit") or FilterFlag(args, "--force"): | 743 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) | |
| 752 return presubmit_support.PresubmitOutput() | 744 return presubmit_support.PresubmitOutput() |
| 753 return DoPresubmitChecks(change_info, committing, True) | 745 return DoPresubmitChecks(change_info, committing, True) |
| 754 | 746 |
| 755 | 747 |
| 756 def defer_attributes(a, b): | 748 def defer_attributes(a, b): |
| 757 """Copy attributes from an object (like a function) to another.""" | 749 """Copy attributes from an object (like a function) to another.""" |
| 758 for x in dir(a): | 750 for x in dir(a): |
| 759 if not getattr(b, x, None): | 751 if not getattr(b, x, None): |
| 760 setattr(b, x, getattr(a, x)) | 752 setattr(b, x, getattr(a, x)) |
| 761 | 753 |
| (...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1522 return 1 | 1514 return 1 |
| 1523 | 1515 |
| 1524 | 1516 |
| 1525 if __name__ == "__main__": | 1517 if __name__ == "__main__": |
| 1526 fix_encoding.fix_encoding() | 1518 fix_encoding.fix_encoding() |
| 1527 try: | 1519 try: |
| 1528 sys.exit(main(sys.argv[1:])) | 1520 sys.exit(main(sys.argv[1:])) |
| 1529 except KeyboardInterrupt: | 1521 except KeyboardInterrupt: |
| 1530 sys.stderr.write('interrupted\n') | 1522 sys.stderr.write('interrupted\n') |
| 1531 sys.exit(1) | 1523 sys.exit(1) |
| OLD | NEW |