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

Side by Side Diff: trychange.py

Issue 558062: Using options.email for svn credential is not a good idea. (Closed)
Patch Set: Created 10 years, 10 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
« no previous file with comments | « no previous file | no next file » | 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/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 import datetime 10 import datetime
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 if options.dry_run: 327 if options.dry_run:
328 return 328 return
329 329
330 # Do an empty checkout. 330 # Do an empty checkout.
331 temp_dir = tempfile.mkdtemp() 331 temp_dir = tempfile.mkdtemp()
332 temp_file = tempfile.NamedTemporaryFile() 332 temp_file = tempfile.NamedTemporaryFile()
333 try: 333 try:
334 try: 334 try:
335 command = ['svn', 'checkout', '--depth', 'empty', '-q', 335 command = ['svn', 'checkout', '--depth', 'empty', '-q',
336 options.svn_repo, temp_dir] 336 options.svn_repo, temp_dir]
337 if options.email:
338 command.extend(['--username', options.email])
339 gclient_utils.CheckCall(command) 337 gclient_utils.CheckCall(command)
340 338
341 # TODO(maruel): Use a subdirectory per user? 339 # TODO(maruel): Use a subdirectory per user?
342 current_time = str(datetime.datetime.now()).replace(':', '.') 340 current_time = str(datetime.datetime.now()).replace(':', '.')
343 file_name = (EscapeDot(options.user) + '.' + EscapeDot(options.name) + 341 file_name = (EscapeDot(options.user) + '.' + EscapeDot(options.name) +
344 '.%s.diff' % current_time) 342 '.%s.diff' % current_time)
345 full_path = os.path.join(temp_dir, file_name) 343 full_path = os.path.join(temp_dir, file_name)
346 full_url = options.svn_repo + '/' + file_name 344 full_url = options.svn_repo + '/' + file_name
347 file_found = False 345 file_found = False
348 try: 346 try:
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 except (InvalidScript, NoTryServerAccess), e: 684 except (InvalidScript, NoTryServerAccess), e:
687 if swallow_exception: 685 if swallow_exception:
688 return 1 686 return 1
689 print e 687 print e
690 return 1 688 return 1
691 return 0 689 return 0
692 690
693 691
694 if __name__ == "__main__": 692 if __name__ == "__main__":
695 sys.exit(TryChange(None, [], False)) 693 sys.exit(TryChange(None, [], False))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698