Make sure drover works when depot_tools is not in the path.

Review URL: http://codereview.chromium.org/341013

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@30865 0039d316-1c4b-4281-b951-d872f2087c98
experimental/szager/collated-output
nsylvain@chromium.org 16 years ago
parent c9f06b00f6
commit 363b4d437a

@ -61,10 +61,19 @@ def clobberDir(dir):
#TODO(laforge) : Is this correct?
deltree(dir)
def runGcl(subcommand):
gcl_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "gcl")
if not os.path.exists(gcl_path):
print "WARNING: gcl not found beside drover.py. Using system gcl instead..."
gcl_path = 'gcl'
command = "%s %s" % (gcl_path, subcommand)
return os.system(command)
def gclUpload(revision, author):
command = ("gcl upload " + str(revision) +
command = ("upload " + str(revision) +
" --send_mail --no_try --no_presubmit --reviewers=" + author)
os.system(command)
return runGcl(command)
def getSVNInfo(url, revision):
command = 'svn info ' + url + "@"+str(revision)
@ -419,10 +428,10 @@ def main(options, args):
out.write("TBR=" + author)
out.close()
change_cmd = 'gcl change ' + str(revision) + " " + filename
change_cmd = 'change ' + str(revision) + " " + filename
if options.revertbot:
change_cmd += ' --silent'
os.system(change_cmd)
runGcl(change_cmd)
os.unlink(filename)
print author
print revision
@ -440,7 +449,7 @@ def main(options, args):
else:
print "Deleting the changelist."
print "gcl delete " + str(revision)
os.system("gcl delete " + str(revision))
runGcl("delete " + str(revision))
sys.exit(0)
# We commit if the reverbot is set to commit automatically, or if this is
@ -448,7 +457,7 @@ def main(options, args):
if options.revertbot_commit or (not options.revertbot and
prompt("Would you like to commit?")):
print "gcl commit " + str(revision) + " --no_presubmit --force"
os.system("gcl commit " + str(revision) + " --no_presubmit --force")
runGcl("commit " + str(revision) + " --no_presubmit --force")
else:
sys.exit(0)
@ -477,4 +486,4 @@ if __name__ == "__main__":
option_parser.error("--merge requires a --branch")
sys.exit(1)
sys.exit(main(options, args))
sys.exit(main(options, args))

Loading…
Cancel
Save