OLD | NEW |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 | 7 |
8 """ | 8 """ |
9 submit_try: Submit a try request. | 9 submit_try: Submit a try request. |
10 | 10 |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
169 if arg == '-h' or arg == '--help': | 169 if arg == '-h' or arg == '--help': |
170 Error() | 170 Error() |
171 elif arg == '-l' or arg == '--list_bots': | 171 elif arg == '-l' or arg == '--list_bots': |
172 print 'submit_try: Available builders:\n %s' % '\n '.join(trybots) | 172 print 'submit_try: Available builders:\n %s' % '\n '.join(trybots) |
173 sys.exit(0) | 173 sys.exit(0) |
174 elif arg == '-b' or arg == '--bot': | 174 elif arg == '-b' or arg == '--bot': |
175 if using_bots: | 175 if using_bots: |
176 Error('--bot specified multiple times.') | 176 Error('--bot specified multiple times.') |
177 if len(argv) < 1: | 177 if len(argv) < 1: |
178 Error('You must specify a builder with "--bot".') | 178 Error('You must specify a builder with "--bot".') |
179 botlist_firstpass_string = '' | |
180 while argv and not argv[0].startswith('-'): | |
181 botlist_firstpass_string += argv.pop(0) | |
182 botlist_firstpass_string += ' ' | |
179 using_bots = [] | 183 using_bots = [] |
180 while argv and not argv[0].startswith('-'): | 184 for bot in botlist_firstpass_string.replace(',', ' ').split(): |
181 bot = argv.pop(0) | |
182 if bot == ALL_BUILDERS: | 185 if bot == ALL_BUILDERS: |
183 if using_bots: | 186 if using_bots: |
184 Error('Cannot specify "all" with additional builder names.') | 187 Error('Cannot specify "all" with additional builder names.') |
185 using_bots = trybots | 188 using_bots = trybots |
186 break | 189 break |
187 else: | 190 else: |
borenet
2013/04/03 18:19:18
I had envisioned just changing this else-case to b
epoger
2013/04/03 18:29:12
I thought about that, but it wouldn't account for
| |
188 if not bot in trybots: | 191 if not bot in trybots: |
189 Error('Unrecognized builder: %s' % bot) | 192 Error('Unrecognized builder: %s' % bot) |
190 using_bots.append(bot) | 193 using_bots.append(bot) |
191 elif arg == '-r': | 194 elif arg == '-r': |
192 if len(argv) < 1: | 195 if len(argv) < 1: |
193 Error('You must specify a revision with "-r".') | 196 Error('You must specify a revision with "-r".') |
194 revision = argv.pop(0) | 197 revision = argv.pop(0) |
195 else: | 198 else: |
196 if changelist or not is_svn: | 199 if changelist or not is_svn: |
197 Error('Unknown argument: %s' % arg) | 200 Error('Unknown argument: %s' % arg) |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
254 is_svn = os.path.isdir('.svn') | 257 is_svn = os.path.isdir('.svn') |
255 | 258 |
256 # Parse and validate the command-line arguments. | 259 # Parse and validate the command-line arguments. |
257 args = ValidateArgs(sys.argv[1:], trybots=trybots, is_svn=is_svn) | 260 args = ValidateArgs(sys.argv[1:], trybots=trybots, is_svn=is_svn) |
258 | 261 |
259 # Submit the try request. | 262 # Submit the try request. |
260 SubmitTryRequest(args, is_svn=is_svn) | 263 SubmitTryRequest(args, is_svn=is_svn) |
261 | 264 |
262 | 265 |
263 if __name__ == '__main__': | 266 if __name__ == '__main__': |
264 sys.exit(main()) | 267 sys.exit(main()) |
OLD | NEW |