Make lookup of last v8 roll work with pure git.

BUG=410721
LOG=n
TBR=jarin@chromium.org

Review URL: https://codereview.chromium.org/540843002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23678 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent c8ffed88
...@@ -19,7 +19,6 @@ CONFIG = { ...@@ -19,7 +19,6 @@ CONFIG = {
CLUSTERFUZZ_API_KEY_FILE: ".cf_api_key", CLUSTERFUZZ_API_KEY_FILE: ".cf_api_key",
} }
CR_DEPS_URL = 'http://src.chromium.org/svn/trunk/src/DEPS'
class CheckActiveRoll(Step): class CheckActiveRoll(Step):
MESSAGE = "Check active roll." MESSAGE = "Check active roll."
...@@ -60,9 +59,11 @@ class DetectLastRoll(Step): ...@@ -60,9 +59,11 @@ class DetectLastRoll(Step):
def RunStep(self): def RunStep(self):
# Interpret the DEPS file to retrieve the v8 revision. # Interpret the DEPS file to retrieve the v8 revision.
# TODO(machenbach): This should be part or the roll-deps api of
# depot_tools.
Var = lambda var: '%s' Var = lambda var: '%s'
exec(self.ReadURL(CR_DEPS_URL)) exec(FileToText(os.path.join(self._options.chromium, "DEPS")))
last_roll = vars['v8_revision'] last_roll = self.GetCommitPositionNumber(vars['v8_revision'])
# FIXME(machenbach): When rolling from bleeding edge and from trunk there # FIXME(machenbach): When rolling from bleeding edge and from trunk there
# be different commit numbers here. Better use version? # be different commit numbers here. Better use version?
if int(last_roll) >= int(self["last_push"]): if int(last_roll) >= int(self["last_push"]):
......
...@@ -804,6 +804,12 @@ Performance and stability improvements on all platforms.""", commit) ...@@ -804,6 +804,12 @@ Performance and stability improvements on all platforms.""", commit)
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22624 123 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22624 123
"""
C_V8_123455_LOG = """V8 CL.
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@123455 123
""" """
C_V8_123456_LOG = """V8 CL. C_V8_123456_LOG = """V8 CL.
...@@ -954,7 +960,7 @@ def get_list(): ...@@ -954,7 +960,7 @@ def get_list():
# Snippet from the original DEPS file. # Snippet from the original DEPS file.
FAKE_DEPS = """ FAKE_DEPS = """
vars = { vars = {
"v8_revision": "123455", "v8_revision": "abcd123455",
} }
deps = { deps = {
"src/v8": "src/v8":
...@@ -964,6 +970,8 @@ deps = { ...@@ -964,6 +970,8 @@ deps = {
""" """
def testAutoRollUpToDate(self): def testAutoRollUpToDate(self):
os.makedirs(TEST_CONFIG[CHROMIUM])
TextToFile(self.FAKE_DEPS, os.path.join(TEST_CONFIG[CHROMIUM], "DEPS"))
self.Expect([ self.Expect([
URL("https://codereview.chromium.org/search", URL("https://codereview.chromium.org/search",
"owner=author%40chromium.org&limit=30&closed=3&format=json", "owner=author%40chromium.org&limit=30&closed=3&format=json",
...@@ -972,8 +980,7 @@ deps = { ...@@ -972,8 +980,7 @@ deps = {
"\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\" " "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\" "
"origin/master"), "push_hash\n"), "origin/master"), "push_hash\n"),
Cmd("git log -1 --format=%B push_hash", self.C_V8_22624_LOG), Cmd("git log -1 --format=%B push_hash", self.C_V8_22624_LOG),
URL("http://src.chromium.org/svn/trunk/src/DEPS", Cmd("git log -1 --format=%B abcd123455", self.C_V8_123455_LOG),
self.FAKE_DEPS),
]) ])
result = auto_roll.AutoRoll(TEST_CONFIG, self).Run( result = auto_roll.AutoRoll(TEST_CONFIG, self).Run(
...@@ -981,6 +988,8 @@ deps = { ...@@ -981,6 +988,8 @@ deps = {
self.assertEquals(1, result) self.assertEquals(1, result)
def testAutoRoll(self): def testAutoRoll(self):
os.makedirs(TEST_CONFIG[CHROMIUM])
TextToFile(self.FAKE_DEPS, os.path.join(TEST_CONFIG[CHROMIUM], "DEPS"))
TEST_CONFIG[CLUSTERFUZZ_API_KEY_FILE] = self.MakeEmptyTempFile() TEST_CONFIG[CLUSTERFUZZ_API_KEY_FILE] = self.MakeEmptyTempFile()
TextToFile("fake key", TEST_CONFIG[CLUSTERFUZZ_API_KEY_FILE]) TextToFile("fake key", TEST_CONFIG[CLUSTERFUZZ_API_KEY_FILE])
...@@ -992,8 +1001,7 @@ deps = { ...@@ -992,8 +1001,7 @@ deps = {
"\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\" " "\"^Version [[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*\" "
"origin/master"), "push_hash\n"), "origin/master"), "push_hash\n"),
Cmd("git log -1 --format=%B push_hash", self.C_V8_123456_LOG), Cmd("git log -1 --format=%B push_hash", self.C_V8_123456_LOG),
URL("http://src.chromium.org/svn/trunk/src/DEPS", Cmd("git log -1 --format=%B abcd123455", self.C_V8_123455_LOG),
self.FAKE_DEPS),
]) ])
result = auto_roll.AutoRoll(TEST_CONFIG, self).Run( result = auto_roll.AutoRoll(TEST_CONFIG, self).Run(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment