Index: tools/push-to-trunk/releases.py |
diff --git a/tools/push-to-trunk/releases.py b/tools/push-to-trunk/releases.py |
index 586cbc1fde9732d1e7c004d9109e0003ec8bac1b..bdefaaed6218738fd6b823a34c4c58d314896dee 100755 |
--- a/tools/push-to-trunk/releases.py |
+++ b/tools/push-to-trunk/releases.py |
@@ -47,10 +47,10 @@ REVIEW_LINK_RE = re.compile(r"^Review URL: (.+)$", re.M) |
# Expression with three versions (historical) for extracting the v8 revision |
# from the chromium DEPS file. |
-DEPS_RE = re.compile(r'^\s*(?:"v8_revision": "' |
- '|\(Var\("googlecode_url"\) % "v8"\) \+ "\/trunk@' |
- '|"http\:\/\/v8\.googlecode\.com\/svn\/trunk@)' |
- '([0-9]+)".*$', re.M) |
+DEPS_RE = re.compile('^\\s*(?:(?:"|\')v8_revision(?:"|\'): (?:"|\')' |
Ryan Tseng
2014/08/25 13:19:17
running regex on the DEPS file? :/
you can use r"
Michael Achenbach
2014/08/25 13:32:52
The """ is good to know, thanks!
|
+ '|\\(Var\\("googlecode_url"\\) % "v8"\\) \\+ "\\/trunk@' |
+ '|"http\\:\\/\\/v8\\.googlecode\\.com\\/svn\\/trunk@)' |
+ '([^"\']+)(?:"|\').*$', re.M) |
# Expression to pick tag and revision for bleeding edge tags. To be used with |
# output of 'svn log'. |
@@ -374,6 +374,18 @@ class UpdateChromiumCheckout(Step): |
self.GitCreateBranch(self.Config(BRANCHNAME)) |
+def ConvertToCommitNumber(step, revision): |
+ if len(revision) > 6: |
Ryan Tseng
2014/08/25 13:19:17
Reversing this make more sense
if revision.isdigi
Michael Achenbach
2014/08/25 13:32:52
Done.
|
+ # Simple check for git hashes. |
+ try: |
+ # TODO(machenbach): Add cwd to git calls. |
+ os.chdir(os.path.join(step["chrome_path"], "v8")) |
Ryan Tseng
2014/08/25 13:19:17
I don't really like this, but seeing how the rest
Michael Achenbach
2014/08/25 13:32:52
Most of this/these files originated from some old
|
+ return step.GitConvertToSVNRevision(revision) |
+ finally: |
+ os.chdir(step["chrome_path"]) |
+ return revision |
+ |
+ |
class RetrieveChromiumV8Releases(Step): |
MESSAGE = "Retrieve V8 releases from Chromium DEPS." |
REQUIRES = "chrome_path" |
@@ -387,6 +399,14 @@ class RetrieveChromiumV8Releases(Step): |
print "No releases detected. Skipping chromium history." |
return True |
+ # Update v8 checkout in chromium. |
+ try: |
+ # TODO(machenbach): Add cwd to git calls. |
+ os.chdir(os.path.join(self["chrome_path"], "v8")) |
+ self.GitFetchOrigin() |
Ryan Tseng
2014/08/25 13:19:17
You might have to either (1) rebase on current bra
Michael Achenbach
2014/08/25 13:32:52
Just reading the svn numbers.
|
+ finally: |
+ os.chdir(self["chrome_path"]) |
+ |
oldest_v8_rev = int(releases[-1]["revision"]) |
cr_releases = [] |
@@ -401,7 +421,7 @@ class RetrieveChromiumV8Releases(Step): |
if match: |
cr_rev = GetCommitPositionNumber(self, git_hash) |
if cr_rev: |
- v8_rev = match.group(1) |
+ v8_rev = ConvertToCommitNumber(self, match.group(1)) |
cr_releases.append([cr_rev, v8_rev]) |
# Stop after reaching beyond the last v8 revision we want to update. |
@@ -458,7 +478,7 @@ class RietrieveChromiumBranches(Step): |
deps = FileToText(self.Config(DEPS_FILE)) |
match = DEPS_RE.search(deps) |
if match: |
- v8_rev = match.group(1) |
+ v8_rev = ConvertToCommitNumber(self, match.group(1)) |
cr_branches.append([str(branch), v8_rev]) |
# Stop after reaching beyond the last v8 revision we want to update. |