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 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1057 | 1057 |
1058 print "Total errors found: %d\n" % cpplint._cpplint_state.error_count | 1058 print "Total errors found: %d\n" % cpplint._cpplint_state.error_count |
1059 os.chdir(previous_cwd) | 1059 os.chdir(previous_cwd) |
1060 | 1060 |
1061 | 1061 |
1062 def DoPresubmitChecks(change_info, committing, may_prompt): | 1062 def DoPresubmitChecks(change_info, committing, may_prompt): |
1063 """Imports presubmit, then calls presubmit.DoPresubmitChecks.""" | 1063 """Imports presubmit, then calls presubmit.DoPresubmitChecks.""" |
1064 # Need to import here to avoid circular dependency. | 1064 # Need to import here to avoid circular dependency. |
1065 import presubmit_support | 1065 import presubmit_support |
1066 root_presubmit = GetCachedFile('PRESUBMIT.py', use_root=True) | 1066 root_presubmit = GetCachedFile('PRESUBMIT.py', use_root=True) |
1067 result = presubmit_support.DoPresubmitChecks(change_info=change_info, | 1067 change = presubmit_support.SvnChange(change_info.name, |
| 1068 change_info.description, |
| 1069 change_info.GetLocalRoot(), |
| 1070 change_info.GetFiles(), |
| 1071 change_info.issue, |
| 1072 change_info.patchset) |
| 1073 result = presubmit_support.DoPresubmitChecks(change=change, |
1068 committing=committing, | 1074 committing=committing, |
1069 verbose=False, | 1075 verbose=False, |
1070 output_stream=sys.stdout, | 1076 output_stream=sys.stdout, |
1071 input_stream=sys.stdin, | 1077 input_stream=sys.stdin, |
1072 default_presubmit=root_presubmit, | 1078 default_presubmit=root_presubmit, |
1073 may_prompt=may_prompt) | 1079 may_prompt=may_prompt) |
1074 if not result and may_prompt: | 1080 if not result and may_prompt: |
1075 print "\nPresubmit errors, can't continue (use --no_presubmit to bypass)" | 1081 print "\nPresubmit errors, can't continue (use --no_presubmit to bypass)" |
1076 return result | 1082 return result |
1077 | 1083 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1192 # the files. This allows commands such as 'gcl diff xxx' to work. | 1198 # the files. This allows commands such as 'gcl diff xxx' to work. |
1193 args =["svn", command] | 1199 args =["svn", command] |
1194 root = GetRepositoryRoot() | 1200 root = GetRepositoryRoot() |
1195 args.extend([os.path.join(root, x) for x in change_info.GetFileNames()]) | 1201 args.extend([os.path.join(root, x) for x in change_info.GetFileNames()]) |
1196 RunShell(args, True) | 1202 RunShell(args, True) |
1197 return 0 | 1203 return 0 |
1198 | 1204 |
1199 | 1205 |
1200 if __name__ == "__main__": | 1206 if __name__ == "__main__": |
1201 sys.exit(main()) | 1207 sys.exit(main()) |
OLD | NEW |