| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2010 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 import optparse | 6 import optparse |
| 7 import os | 7 import os |
| 8 import re | 8 import re |
| 9 import subprocess | 9 import subprocess |
| 10 import sys | 10 import sys |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 gcl_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "gcl") | 76 gcl_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "gcl") |
| 77 if not os.path.exists(gcl_path): | 77 if not os.path.exists(gcl_path): |
| 78 print "WARNING: gcl not found beside drover.py. Using system gcl instead..." | 78 print "WARNING: gcl not found beside drover.py. Using system gcl instead..." |
| 79 gcl_path = 'gcl' | 79 gcl_path = 'gcl' |
| 80 | 80 |
| 81 command = "%s %s" % (gcl_path, subcommand) | 81 command = "%s %s" % (gcl_path, subcommand) |
| 82 return os.system(command) | 82 return os.system(command) |
| 83 | 83 |
| 84 def gclUpload(revision, author): | 84 def gclUpload(revision, author): |
| 85 command = ("upload " + str(revision) + | 85 command = ("upload " + str(revision) + |
| 86 " --send_mail --no_try --no_presubmit --reviewers=" + author) | 86 " --send_mail --no_presubmit --reviewers=" + author) |
| 87 return runGcl(command) | 87 return runGcl(command) |
| 88 | 88 |
| 89 def getSVNInfo(url, revision): | 89 def getSVNInfo(url, revision): |
| 90 command = 'svn info ' + url + "@"+str(revision) | 90 command = 'svn info ' + url + "@"+str(revision) |
| 91 svn_info = subprocess.Popen(command, | 91 svn_info = subprocess.Popen(command, |
| 92 shell=True, | 92 shell=True, |
| 93 stdout=subprocess.PIPE, | 93 stdout=subprocess.PIPE, |
| 94 stderr=subprocess.PIPE).stdout.readlines() | 94 stderr=subprocess.PIPE).stdout.readlines() |
| 95 info = {} | 95 info = {} |
| 96 for line in svn_info: | 96 for line in svn_info: |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 change_cmd += ' --silent' | 518 change_cmd += ' --silent' |
| 519 runGcl(change_cmd) | 519 runGcl(change_cmd) |
| 520 os.unlink(filename) | 520 os.unlink(filename) |
| 521 | 521 |
| 522 if options.local: | 522 if options.local: |
| 523 return 0 | 523 return 0 |
| 524 | 524 |
| 525 print author | 525 print author |
| 526 print revision | 526 print revision |
| 527 print ("gcl upload " + str(revision) + | 527 print ("gcl upload " + str(revision) + |
| 528 " --send_mail --no_try --no_presubmit --reviewers=" + author) | 528 " --send_mail --no_presubmit --reviewers=" + author) |
| 529 | 529 |
| 530 if options.revertbot or prompt("Would you like to upload?"): | 530 if options.revertbot or prompt("Would you like to upload?"): |
| 531 if PROMPT_FOR_AUTHOR: | 531 if PROMPT_FOR_AUTHOR: |
| 532 author = text_prompt("Enter new author or press enter to accept default", | 532 author = text_prompt("Enter new author or press enter to accept default", |
| 533 author) | 533 author) |
| 534 if options.revertbot and options.revertbot_reviewers: | 534 if options.revertbot and options.revertbot_reviewers: |
| 535 author += "," | 535 author += "," |
| 536 author += options.revertbot_reviewers | 536 author += options.revertbot_reviewers |
| 537 gclUpload(revision, author) | 537 gclUpload(revision, author) |
| 538 else: | 538 else: |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 | 584 |
| 585 if options.local and (options.revert or options.branch): | 585 if options.local and (options.revert or options.branch): |
| 586 option_parser.error("--local cannot be used with --revert or --branch") | 586 option_parser.error("--local cannot be used with --revert or --branch") |
| 587 return 1 | 587 return 1 |
| 588 | 588 |
| 589 return drover(options, args) | 589 return drover(options, args) |
| 590 | 590 |
| 591 | 591 |
| 592 if __name__ == "__main__": | 592 if __name__ == "__main__": |
| 593 sys.exit(main()) | 593 sys.exit(main()) |
| OLD | NEW |