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

Side by Side Diff: presubmit_support.py

Issue 9664015: Adds saner behavior for git try -t foo to not fail in a inexplicable way. Enforces that each builde… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: improve comment Created 8 years, 9 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 | « no previous file | tests/presubmit_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) 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 """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 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 if not isinstance(result, types.ListType): 919 if not isinstance(result, types.ListType):
920 raise PresubmitFailure( 920 raise PresubmitFailure(
921 'Presubmit functions must return a list, got a %s instead: %s' % 921 'Presubmit functions must return a list, got a %s instead: %s' %
922 (type(result), str(result))) 922 (type(result), str(result)))
923 for item in result: 923 for item in result:
924 if not isinstance(item, basestring): 924 if not isinstance(item, basestring):
925 raise PresubmitFailure('All try slaves names must be strings.') 925 raise PresubmitFailure('All try slaves names must be strings.')
926 if item != item.strip(): 926 if item != item.strip():
927 raise PresubmitFailure( 927 raise PresubmitFailure(
928 'Try slave names cannot start/end with whitespace') 928 'Try slave names cannot start/end with whitespace')
929 if ',' in item:
930 raise PresubmitFailure(
931 'Do not use \',\' separated builder or test names: %s' % item)
929 else: 932 else:
930 result = [] 933 result = []
931 return result 934 return result
932 935
933 936
934 def DoGetTrySlaves(change, 937 def DoGetTrySlaves(change,
935 changed_files, 938 changed_files,
936 repository_root, 939 repository_root,
937 default_presubmit, 940 default_presubmit,
938 project, 941 project,
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
1265 except PresubmitFailure, e: 1268 except PresubmitFailure, e:
1266 print >> sys.stderr, e 1269 print >> sys.stderr, e
1267 print >> sys.stderr, 'Maybe your depot_tools is out of date?' 1270 print >> sys.stderr, 'Maybe your depot_tools is out of date?'
1268 print >> sys.stderr, 'If all fails, contact maruel@' 1271 print >> sys.stderr, 'If all fails, contact maruel@'
1269 return 2 1272 return 2
1270 1273
1271 1274
1272 if __name__ == '__main__': 1275 if __name__ == '__main__':
1273 fix_encoding.fix_encoding() 1276 fix_encoding.fix_encoding()
1274 sys.exit(Main(None)) 1277 sys.exit(Main(None))
OLDNEW
« no previous file with comments | « no previous file | tests/presubmit_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698