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

Unified Diff: tools/push-to-trunk/git_recipes.py

Issue 500023003: Teach v8rel script to read git hashes from DEPS. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review Created 6 years, 4 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
« no previous file with comments | « no previous file | tools/push-to-trunk/releases.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/push-to-trunk/git_recipes.py
diff --git a/tools/push-to-trunk/git_recipes.py b/tools/push-to-trunk/git_recipes.py
index 6ffb2da83405d85322471607e126624021d1abbb..1cbd8f5149802498e3d91fecc2d5f50a9c595ca9 100644
--- a/tools/push-to-trunk/git_recipes.py
+++ b/tools/push-to-trunk/git_recipes.py
@@ -28,6 +28,9 @@
import re
+SHA1_RE = re.compile('^[a-fA-F0-9]{40}$')
+GIT_SVN_ID_RE = re.compile('^git-svn-id: .*@([0-9]+) .*$')
+
class GitFailedException(Exception):
pass
@@ -185,6 +188,20 @@ class GitRecipesMixin(object):
def GitPull(self):
self.Git("pull")
+ def GitFetchOrigin(self):
+ self.Git("fetch origin")
+
+ def GitConvertToSVNRevision(self, git_hash):
+ result = self.Git(MakeArgs(["rev-list", "-n", "1", git_hash]))
+ if not result or not SHA1_RE.match(result):
+ raise GitFailedException("Git hash %s is unknown." % git_hash)
+ log = self.GitLog(n=1, format="%B", git_hash=git_hash)
+ for line in reversed(log.splitlines()):
+ match = GIT_SVN_ID_RE.match(line.strip())
+ if match:
+ return match.group(1)
+ raise GitFailedException("Couldn't convert %s to SVN." % git_hash)
+
def GitSVNFetch(self):
self.Git("svn fetch")
« no previous file with comments | « no previous file | tools/push-to-trunk/releases.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698