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

Unified Diff: drover.py

Issue 341013: Make sure drover works when depot_tools is not in the path. (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/tools/depot_tools/
Patch Set: '' Created 11 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: drover.py
===================================================================
--- drover.py (revision 30763)
+++ drover.py (working copy)
@@ -61,10 +61,19 @@
#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 @@
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 @@
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 @@
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 @@
option_parser.error("--merge requires a --branch")
sys.exit(1)
- sys.exit(main(options, args))
+ sys.exit(main(options, args))
« 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