Teach chromium_roll script to roll v8 git hashes.

TEST=script_test.py
R=hinoka@google.com

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23379 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 62c53bce
...@@ -84,11 +84,9 @@ class UploadCL(Step): ...@@ -84,11 +84,9 @@ class UploadCL(Step):
os.chdir(self["chrome_path"]) os.chdir(self["chrome_path"])
# Patch DEPS file. # Patch DEPS file.
deps = FileToText(self.Config(DEPS_FILE)) if self._side_effect_handler.Command(
deps = re.sub("(?<=\"v8_revision\": \")([0-9]+)(?=\")", "roll-dep", "v8 %s" % self["trunk_revision"]) is None:
self["trunk_revision"], self.Die("Failed to create deps for %s" % self["trunk_revision"])
deps)
TextToFile(deps, self.Config(DEPS_FILE))
if self._options.reviewer and not self._options.manual: if self._options.reviewer and not self._options.manual:
print "Using account %s for review." % self._options.reviewer print "Using account %s for review." % self._options.reviewer
......
...@@ -369,6 +369,7 @@ class ScriptTest(unittest.TestCase): ...@@ -369,6 +369,7 @@ class ScriptTest(unittest.TestCase):
MOCKS = { MOCKS = {
"git": GitMock, "git": GitMock,
"roll-dep": GitMock, # TODO(machenbach): Yet another hack. Unify all mocks.
# TODO(machenbach): Little hack to reuse the git mock for the one svn call # TODO(machenbach): Little hack to reuse the git mock for the one svn call
# in merge-to-branch. The command should be made explicit in the test # in merge-to-branch. The command should be made explicit in the test
# expectations. # expectations.
...@@ -834,6 +835,9 @@ def get_list(): ...@@ -834,6 +835,9 @@ def get_list():
os.makedirs(TEST_CONFIG[CHROMIUM]) os.makedirs(TEST_CONFIG[CHROMIUM])
TextToFile("Some line\n \"v8_revision\": \"123444\",\n some line", TextToFile("Some line\n \"v8_revision\": \"123444\",\n some line",
TEST_CONFIG[DEPS_FILE]) TEST_CONFIG[DEPS_FILE])
def WriteDeps():
TextToFile("Some line\n \"v8_revision\": \"123455\",\n some line",
TEST_CONFIG[DEPS_FILE])
os.environ["EDITOR"] = "vi" os.environ["EDITOR"] = "vi"
force_flag = " -f" if not manual else "" force_flag = " -f" if not manual else ""
...@@ -851,6 +855,7 @@ def get_list(): ...@@ -851,6 +855,7 @@ def get_list():
Git("checkout -f master", ""), Git("checkout -f master", ""),
Git("pull", ""), Git("pull", ""),
Git("checkout -b v8-roll-123455", ""), Git("checkout -b v8-roll-123455", ""),
Git("v8 123455", "rolled", cb=WriteDeps),
Git(("commit -am \"Update V8 to version 3.22.5 " Git(("commit -am \"Update V8 to version 3.22.5 "
"(based on bleeding_edge revision r123454).\n\n" "(based on bleeding_edge revision r123454).\n\n"
"Please reply to the V8 sheriff c_name@chromium.org in " "Please reply to the V8 sheriff c_name@chromium.org in "
......
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