| Index: tools/push-to-trunk/chromium_roll.py
|
| diff --git a/tools/push-to-trunk/chromium_roll.py b/tools/push-to-trunk/chromium_roll.py
|
| index 44d7f3157f94dbf76774a3113381846ba230d847..4e0137057170b839483d64d2751b82af48d54635 100755
|
| --- a/tools/push-to-trunk/chromium_roll.py
|
| +++ b/tools/push-to-trunk/chromium_roll.py
|
| @@ -37,25 +37,12 @@ class DetectLastPush(Step):
|
| git_hash=self["last_push"])
|
|
|
|
|
| -class CheckChromium(Step):
|
| - MESSAGE = "Ask for chromium checkout."
|
| -
|
| - def Run(self):
|
| - self["chrome_path"] = self._options.chromium
|
| - while not self["chrome_path"]:
|
| - self.DieNoManualMode("Please specify the path to a Chromium checkout in "
|
| - "forced mode.")
|
| - print ("Please specify the path to the chromium \"src\" directory: "),
|
| - self["chrome_path"] = self.ReadLine()
|
| -
|
| -
|
| class SwitchChromium(Step):
|
| MESSAGE = "Switch to Chromium checkout."
|
| - REQUIRES = "chrome_path"
|
|
|
| def RunStep(self):
|
| self["v8_path"] = os.getcwd()
|
| - os.chdir(self["chrome_path"])
|
| + os.chdir(self._options.chromium)
|
| self.InitialEnvironmentChecks()
|
| # Check for a clean workdir.
|
| if not self.GitIsWorkdirClean(): # pragma: no cover
|
| @@ -67,57 +54,47 @@ class SwitchChromium(Step):
|
|
|
| class UpdateChromiumCheckout(Step):
|
| MESSAGE = "Update the checkout and create a new branch."
|
| - REQUIRES = "chrome_path"
|
|
|
| def RunStep(self):
|
| - os.chdir(self["chrome_path"])
|
| + os.chdir(self._options.chromium)
|
| self.GitCheckout("master")
|
| self._side_effect_handler.Command("gclient", "sync --nohooks")
|
| self.GitPull()
|
| try:
|
| # TODO(machenbach): Add cwd to git calls.
|
| - os.chdir(os.path.join(self["chrome_path"], "v8"))
|
| + os.chdir(os.path.join(self._options.chromium, "v8"))
|
| self.GitFetchOrigin()
|
| finally:
|
| - os.chdir(self["chrome_path"])
|
| + os.chdir(self._options.chromium)
|
| self.GitCreateBranch("v8-roll-%s" % self["trunk_revision"])
|
|
|
|
|
| class UploadCL(Step):
|
| MESSAGE = "Create and upload CL."
|
| - REQUIRES = "chrome_path"
|
|
|
| def RunStep(self):
|
| - os.chdir(self["chrome_path"])
|
| + os.chdir(self._options.chromium)
|
|
|
| # Patch DEPS file.
|
| if self._side_effect_handler.Command(
|
| "roll-dep", "v8 %s" % self["trunk_revision"]) is None:
|
| self.Die("Failed to create deps for %s" % self["trunk_revision"])
|
|
|
| - if self._options.reviewer and not self._options.manual:
|
| - print "Using account %s for review." % self._options.reviewer
|
| - rev = self._options.reviewer
|
| - else:
|
| - print "Please enter the email address of a reviewer for the roll CL: ",
|
| - self.DieNoManualMode("A reviewer must be specified in forced mode.")
|
| - rev = self.ReadLine()
|
| -
|
| commit_title = "Update V8 to %s." % self["push_title"].lower()
|
| sheriff = ""
|
| if self["sheriff"]:
|
| sheriff = ("\n\nPlease reply to the V8 sheriff %s in case of problems."
|
| % self["sheriff"])
|
| - self.GitCommit("%s%s\n\nTBR=%s" % (commit_title, sheriff, rev))
|
| + self.GitCommit("%s%s\n\nTBR=%s" %
|
| + (commit_title, sheriff, self._options.reviewer))
|
| self.GitUpload(author=self._options.author,
|
| - force=self._options.force_upload,
|
| + force=True,
|
| cq=self._options.use_commit_queue)
|
| print "CL uploaded."
|
|
|
|
|
| class SwitchV8(Step):
|
| MESSAGE = "Returning to V8 checkout."
|
| - REQUIRES = "chrome_path"
|
|
|
| def RunStep(self):
|
| os.chdir(self["v8_path"])
|
| @@ -137,14 +114,7 @@ class CleanUp(Step):
|
|
|
| class ChromiumRoll(ScriptsBase):
|
| def _PrepareOptions(self, parser):
|
| - group = parser.add_mutually_exclusive_group()
|
| - group.add_argument("-f", "--force",
|
| - help="Don't prompt the user.",
|
| - default=False, action="store_true")
|
| - group.add_argument("-m", "--manual",
|
| - help="Prompt the user at every important step.",
|
| - default=False, action="store_true")
|
| - parser.add_argument("-c", "--chromium",
|
| + parser.add_argument("-c", "--chromium", required=True,
|
| help=("The path to your Chromium src/ "
|
| "directory to automate the V8 roll."))
|
| parser.add_argument("-l", "--last-push",
|
| @@ -154,24 +124,19 @@ class ChromiumRoll(ScriptsBase):
|
| default=False, action="store_true")
|
|
|
| def _ProcessOptions(self, options): # pragma: no cover
|
| - if not options.manual and not options.reviewer:
|
| - print "A reviewer (-r) is required in (semi-)automatic mode."
|
| - return False
|
| - if not options.manual and not options.chromium:
|
| - print "A chromium checkout (-c) is required in (semi-)automatic mode."
|
| - return False
|
| - if not options.manual and not options.author:
|
| - print "Specify your chromium.org email with -a in (semi-)automatic mode."
|
| + if not options.author or not options.reviewer:
|
| + print "A reviewer (-r) and an author (-a) are required."
|
| return False
|
|
|
| - options.tbr_commit = not options.manual
|
| + options.requires_editor = False
|
| + options.force = True
|
| + options.manual = False
|
| return True
|
|
|
| def _Steps(self):
|
| return [
|
| Preparation,
|
| DetectLastPush,
|
| - CheckChromium,
|
| DetermineV8Sheriff,
|
| SwitchChromium,
|
| UpdateChromiumCheckout,
|
|
|