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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 if not change: | 369 if not change: |
370 if not changed_files: | 370 if not changed_files: |
371 changed_files = checkouts[0].file_tuples | 371 changed_files = checkouts[0].file_tuples |
372 change = presubmit_support.Change(options.name, | 372 change = presubmit_support.Change(options.name, |
373 '', | 373 '', |
374 checkouts[0].checkout_root, | 374 checkouts[0].checkout_root, |
375 changed_files, | 375 changed_files, |
376 options.issue, | 376 options.issue, |
377 options.patchset, | 377 options.patchset, |
378 options.email) | 378 options.email) |
379 trybots = presubmit_support.DoGetTryMasters( | 379 masters = presubmit_support.DoGetTryMasters( |
380 change, | 380 change, |
381 checkouts[0].GetFileNames(), | 381 checkouts[0].GetFileNames(), |
382 checkouts[0].checkout_root, | 382 checkouts[0].checkout_root, |
383 root_presubmit, | 383 root_presubmit, |
384 options.project, | 384 options.project, |
385 options.verbose, | 385 options.verbose, |
386 sys.stdout).get('tryserver.chromium', []) | 386 sys.stdout) |
| 387 |
| 388 # Compatibility for old checkouts and bots that were on tryserver.chromium. |
| 389 trybots = masters.get('tryserver.chromium', []) |
| 390 |
| 391 # Compatibility for checkouts that are not using tryserver.chromium |
| 392 # but are stuck with git-try or gcl-try. |
| 393 if not trybots and len(masters) == 1: |
| 394 trybots = masters.values()[0] |
| 395 |
387 if trybots: | 396 if trybots: |
388 old_style = filter(lambda x: isinstance(x, basestring), trybots) | 397 old_style = filter(lambda x: isinstance(x, basestring), trybots) |
389 new_style = filter(lambda x: isinstance(x, tuple), trybots) | 398 new_style = filter(lambda x: isinstance(x, tuple), trybots) |
390 | 399 |
391 # _ParseBotList's testfilter is set to None otherwise it will complain. | 400 # _ParseBotList's testfilter is set to None otherwise it will complain. |
392 bot_spec = _ApplyTestFilter(options.testfilter, | 401 bot_spec = _ApplyTestFilter(options.testfilter, |
393 _ParseBotList(old_style, None)) | 402 _ParseBotList(old_style, None)) |
394 | 403 |
395 bot_spec.extend(_ApplyTestFilter(options.testfilter, new_style)) | 404 bot_spec.extend(_ApplyTestFilter(options.testfilter, new_style)) |
396 | 405 |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
928 return 1 | 937 return 1 |
929 except (gclient_utils.Error, subprocess2.CalledProcessError), e: | 938 except (gclient_utils.Error, subprocess2.CalledProcessError), e: |
930 print >> sys.stderr, e | 939 print >> sys.stderr, e |
931 return 1 | 940 return 1 |
932 return 0 | 941 return 0 |
933 | 942 |
934 | 943 |
935 if __name__ == "__main__": | 944 if __name__ == "__main__": |
936 fix_encoding.fix_encoding() | 945 fix_encoding.fix_encoding() |
937 sys.exit(TryChange(None, None, False)) | 946 sys.exit(TryChange(None, None, False)) |
OLD | NEW |