OLD | NEW |
---|---|
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2009 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 """Client-side script to send a try job to the try server. It communicates to | 5 """Client-side script to send a try job to the try server. It communicates to |
6 the try server by either writting to a svn repository or by directly connecting | 6 the try server by either writting to a svn repository or by directly connecting |
7 to the server by HTTP. | 7 to the server by HTTP. |
8 """ | 8 """ |
9 | 9 |
10 | 10 |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
305 for (k,v) in values.iteritems(): | 305 for (k,v) in values.iteritems(): |
306 description += "%s=%s\n" % (k,v) | 306 description += "%s=%s\n" % (k,v) |
307 | 307 |
308 # Do an empty checkout. | 308 # Do an empty checkout. |
309 temp_dir = tempfile.mkdtemp() | 309 temp_dir = tempfile.mkdtemp() |
310 temp_file = tempfile.NamedTemporaryFile() | 310 temp_file = tempfile.NamedTemporaryFile() |
311 temp_file_name = temp_file.name | 311 temp_file_name = temp_file.name |
312 try: | 312 try: |
313 # Don't use '--non-interactive', since we want it to prompt for | 313 # Don't use '--non-interactive', since we want it to prompt for |
314 # crendentials if necessary. | 314 # crendentials if necessary. |
315 RunCommand(['svn', 'checkout', '--depth', 'empty', | 315 command = ['svn', 'checkout', '--depth', 'empty', |
316 '--username', options.email, | 316 options.svn_repo, temp_dir] |
Mark Mentovai
2009/09/02 04:01:44
Pull this to the left one space now to keep it lin
Nico
2009/09/02 04:05:03
Done.
| |
317 options.svn_repo, temp_dir]) | 317 if options.email: |
318 command += ['--username', options.email] | |
319 RunCommand(command) | |
318 # TODO(maruel): Use a subdirectory per user? | 320 # TODO(maruel): Use a subdirectory per user? |
319 current_time = str(datetime.datetime.now()).replace(':', '.') | 321 current_time = str(datetime.datetime.now()).replace(':', '.') |
320 file_name = (EscapeDot(options.user) + '.' + EscapeDot(options.name) + | 322 file_name = (EscapeDot(options.user) + '.' + EscapeDot(options.name) + |
321 '.%s.diff' % current_time) | 323 '.%s.diff' % current_time) |
322 full_path = os.path.join(temp_dir, file_name) | 324 full_path = os.path.join(temp_dir, file_name) |
323 full_url = options.svn_repo + '/' + file_name | 325 full_url = options.svn_repo + '/' + file_name |
324 file_found = False | 326 file_found = False |
325 try: | 327 try: |
326 RunCommand(['svn', 'ls', full_url]) | 328 RunCommand(['svn', 'ls', full_url]) |
327 file_found = True | 329 file_found = True |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
521 if patch_name == 'Unnamed': | 523 if patch_name == 'Unnamed': |
522 print "Note: use --name NAME to change the try's name." | 524 print "Note: use --name NAME to change the try's name." |
523 except (InvalidScript, NoTryServerAccess), e: | 525 except (InvalidScript, NoTryServerAccess), e: |
524 if swallow_exception: | 526 if swallow_exception: |
525 return | 527 return |
526 print e | 528 print e |
527 | 529 |
528 | 530 |
529 if __name__ == "__main__": | 531 if __name__ == "__main__": |
530 TryChange(None, None, False) | 532 TryChange(None, None, False) |
OLD | NEW |