OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2006-2009 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 # Wrapper script around Rietveld's upload.py that groups files into | 6 # Wrapper script around Rietveld's upload.py that groups files into |
7 # changelists. | 7 # changelists. |
8 | 8 |
9 import getpass | 9 import getpass |
10 import os | 10 import os |
(...skipping 969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
980 else: | 980 else: |
981 cpplint.ProcessFile(file, cpplint._cpplint_state.verbose_level) | 981 cpplint.ProcessFile(file, cpplint._cpplint_state.verbose_level) |
982 | 982 |
983 print "Total errors found: %d\n" % cpplint._cpplint_state.error_count | 983 print "Total errors found: %d\n" % cpplint._cpplint_state.error_count |
984 os.chdir(previous_cwd) | 984 os.chdir(previous_cwd) |
985 | 985 |
986 | 986 |
987 def DoPresubmitChecks(change_info, committing): | 987 def DoPresubmitChecks(change_info, committing): |
988 """Imports presubmit, then calls presubmit.DoPresubmitChecks.""" | 988 """Imports presubmit, then calls presubmit.DoPresubmitChecks.""" |
989 # Need to import here to avoid circular dependency. | 989 # Need to import here to avoid circular dependency. |
990 import presubmit | 990 import presubmit_support |
991 result = presubmit.DoPresubmitChecks(change_info, | 991 result = presubmit_support.DoPresubmitChecks(change_info, |
992 committing, | 992 committing, |
993 verbose=False, | 993 verbose=False, |
994 output_stream=sys.stdout, | 994 output_stream=sys.stdout, |
995 input_stream=sys.stdin) | 995 input_stream=sys.stdin) |
996 if not result: | 996 if not result: |
997 print "\nPresubmit errors, can't continue (use --no_presubmit to bypass)" | 997 print "\nPresubmit errors, can't continue (use --no_presubmit to bypass)" |
998 return result | 998 return result |
999 | 999 |
1000 | 1000 |
1001 def Changes(): | 1001 def Changes(): |
1002 """Print all the changelists and their files.""" | 1002 """Print all the changelists and their files.""" |
1003 for cl in GetCLs(): | 1003 for cl in GetCLs(): |
1004 change_info = LoadChangelistInfo(cl, True, True) | 1004 change_info = LoadChangelistInfo(cl, True, True) |
1005 print "\n--- Changelist " + change_info.name + ":" | 1005 print "\n--- Changelist " + change_info.name + ":" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1092 # the files. This allows commands such as 'gcl diff xxx' to work. | 1092 # the files. This allows commands such as 'gcl diff xxx' to work. |
1093 args =["svn", command] | 1093 args =["svn", command] |
1094 root = GetRepositoryRoot() | 1094 root = GetRepositoryRoot() |
1095 args.extend([os.path.join(root, x) for x in change_info.FileList()]) | 1095 args.extend([os.path.join(root, x) for x in change_info.FileList()]) |
1096 RunShell(args, True) | 1096 RunShell(args, True) |
1097 return 0 | 1097 return 0 |
1098 | 1098 |
1099 | 1099 |
1100 if __name__ == "__main__": | 1100 if __name__ == "__main__": |
1101 sys.exit(main()) | 1101 sys.exit(main()) |
OLD | NEW |