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 """Client-side script to send a try job to the try server. It communicates to | 6 """Client-side script to send a try job to the try server. It communicates to |
7 the try server by either writting to a svn repository or by directly connecting | 7 the try server by either writting to a svn repository or by directly connecting |
8 to the server by HTTP. | 8 to the server by HTTP. |
9 """ | 9 """ |
10 | 10 |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
374 options.email) | 374 options.email) |
375 trybots = presubmit_support.DoGetTrySlaves( | 375 trybots = presubmit_support.DoGetTrySlaves( |
376 change, | 376 change, |
377 checkouts[0].GetFileNames(), | 377 checkouts[0].GetFileNames(), |
378 checkouts[0].checkout_root, | 378 checkouts[0].checkout_root, |
379 root_presubmit, | 379 root_presubmit, |
380 options.project, | 380 options.project, |
381 options.verbose, | 381 options.verbose, |
382 sys.stdout) | 382 sys.stdout) |
383 if trybots: | 383 if trybots: |
384 if isinstance(trybots[0], basestring): | 384 old_style = filter(lambda x: isinstance(x, basestring), trybots) |
385 # PRESUBMIT.py sent us an old-style string list of bots. | 385 new_style = filter(lambda x: isinstance(x, tuple), trybots) |
386 # _ParseBotList's testfilter is set to None otherwise it will complain. | 386 |
387 bot_spec = _ApplyTestFilter(options.testfilter, | 387 # _ParseBotList's testfilter is set to None otherwise it will complain. |
388 _ParseBotList(trybots, None)) | 388 bot_spec = _ApplyTestFilter(options.testfilter, |
389 else: | 389 _ParseBotList(old_style, None)) |
390 # PRESUBMIT.py sent us a new-style (bot, set()) specification. | 390 |
391 bot_spec = _ApplyTestFilter(options.testfilter, trybots) | 391 bot_spec += _ApplyTestFilter(options.testfilter, new_style) |
M-A Ruel
2013/12/04 01:02:31
I really dislike += on list. It does silly things
| |
392 | 392 |
393 except ImportError: | 393 except ImportError: |
394 pass | 394 pass |
395 | 395 |
396 return bot_spec | 396 return bot_spec |
397 | 397 |
398 | 398 |
399 def _ParseSendChangeOptions(bot_spec, options): | 399 def _ParseSendChangeOptions(bot_spec, options): |
400 """Parse common options passed to _SendChangeHTTP and _SendChangeSVN.""" | 400 """Parse common options passed to _SendChangeHTTP and _SendChangeSVN.""" |
401 values = [ | 401 values = [ |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
933 return 1 | 933 return 1 |
934 except (gclient_utils.Error, subprocess2.CalledProcessError), e: | 934 except (gclient_utils.Error, subprocess2.CalledProcessError), e: |
935 print >> sys.stderr, e | 935 print >> sys.stderr, e |
936 return 1 | 936 return 1 |
937 return 0 | 937 return 0 |
938 | 938 |
939 | 939 |
940 if __name__ == "__main__": | 940 if __name__ == "__main__": |
941 fix_encoding.fix_encoding() | 941 fix_encoding.fix_encoding() |
942 sys.exit(TryChange(None, None, False)) | 942 sys.exit(TryChange(None, None, False)) |
OLD | NEW |