Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(533)

Side by Side Diff: presubmit_support.py

Issue 8038028: Use universal EOL conversion when calling the text editor in gcl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gcl.py ('k') | tests/gcl_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 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 """Enables directory-specific presubmit checks to run at upload and/or commit. 6 """Enables directory-specific presubmit checks to run at upload and/or commit.
7 """ 7 """
8 8
9 __version__ = '1.6.1' 9 __version__ = '1.6.1'
10 10
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 context = {} 890 context = {}
891 try: 891 try:
892 exec script_text in context 892 exec script_text in context
893 except Exception, e: 893 except Exception, e:
894 raise PresubmitFailure('"%s" had an exception.\n%s' % (presubmit_path, e)) 894 raise PresubmitFailure('"%s" had an exception.\n%s' % (presubmit_path, e))
895 895
896 function_name = 'GetPreferredTrySlaves' 896 function_name = 'GetPreferredTrySlaves'
897 if function_name in context: 897 if function_name in context:
898 get_preferred_try_slaves = context[function_name] 898 get_preferred_try_slaves = context[function_name]
899 function_info = inspect.getargspec(get_preferred_try_slaves) 899 function_info = inspect.getargspec(get_preferred_try_slaves)
900 if len(function_info.args) == 1: 900 if len(function_info[0]) == 1:
901 result = get_preferred_try_slaves(project) 901 result = get_preferred_try_slaves(project)
902 elif len(function_info.args) == 2: 902 elif len(function_info[0]) == 2:
903 result = get_preferred_try_slaves(project, change) 903 result = get_preferred_try_slaves(project, change)
904 else: 904 else:
905 result = get_preferred_try_slaves() 905 result = get_preferred_try_slaves()
906 if not isinstance(result, types.ListType): 906 if not isinstance(result, types.ListType):
907 raise PresubmitFailure( 907 raise PresubmitFailure(
908 'Presubmit functions must return a list, got a %s instead: %s' % 908 'Presubmit functions must return a list, got a %s instead: %s' %
909 (type(result), str(result))) 909 (type(result), str(result)))
910 for item in result: 910 for item in result:
911 if not isinstance(item, basestring): 911 if not isinstance(item, basestring):
912 raise PresubmitFailure('All try slaves names must be strings.') 912 raise PresubmitFailure('All try slaves names must be strings.')
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
1252 except PresubmitFailure, e: 1252 except PresubmitFailure, e:
1253 print >> sys.stderr, e 1253 print >> sys.stderr, e
1254 print >> sys.stderr, 'Maybe your depot_tools is out of date?' 1254 print >> sys.stderr, 'Maybe your depot_tools is out of date?'
1255 print >> sys.stderr, 'If all fails, contact maruel@' 1255 print >> sys.stderr, 'If all fails, contact maruel@'
1256 return 2 1256 return 2
1257 1257
1258 1258
1259 if __name__ == '__main__': 1259 if __name__ == '__main__':
1260 fix_encoding.fix_encoding() 1260 fix_encoding.fix_encoding()
1261 sys.exit(Main(None)) 1261 sys.exit(Main(None))
OLDNEW
« no previous file with comments | « gcl.py ('k') | tests/gcl_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698