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

Unified Diff: tools/testrunner/server/work_handler.py

Issue 11013007: Test runner: Send SVN revision instead of git commit hash in work packet (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: tools/testrunner/server/work_handler.py
diff --git a/tools/testrunner/server/work_handler.py b/tools/testrunner/server/work_handler.py
index d1e0666c41790bc7bae2f96a08fe2b12736f1260..9e61af8227adaff2c1c314de77f1d0a3131ef44d 100644
--- a/tools/testrunner/server/work_handler.py
+++ b/tools/testrunner/server/work_handler.py
@@ -102,11 +102,22 @@ class WorkHandler(SocketServer.BaseRequestHandler):
os.chmod(target, stat.S_IRWXU)
return True
- def _CheckoutRevision(self, base_revision):
- code = self._Call("git checkout -f %s" % base_revision)
- if code != 0:
+ def _CheckoutRevision(self, base_svn_revision):
+ get_hash_cmd = (
+ "git log -1 --format=%%H --remotes --grep='^git-svn-id:.*@%s'" %
+ base_svn_revision)
+ try:
+ base_revision = subprocess.check_output(get_hash_cmd, shell=True)
+ if not base_revision: raise ValueError
+ except:
self._Call("git fetch")
- code = self._Call("git checkout -f %s" % base_revision)
+ try:
+ base_revision = subprocess.check_output(get_hash_cmd, shell=True)
+ if not base_revision: raise ValueError
+ except:
+ self._SendResponse("Base revision not found.")
+ return False
+ code = self._Call("git checkout -f %s" % base_revision)
if code != 0:
self._SendResponse("Error trying to check out base revision.")
return False

Powered by Google App Engine
This is Rietveld 408576698