Commit 22e808eb authored by Michael Achenbach's avatar Michael Achenbach Committed by Commit Bot

[release] Explicitly use Gerrit in all release tools

Pass --gerrit explicitly to be resiliant to possible rollbacks of the Gerrit
switch.

This'll also enforce using Gerrit on older release branches when using
the release tools for cherry-picking.

NOTRY=true
TBR=hablich@chromium.org

Bug: chromium:685318
Change-Id: If60784b4c804f38ca36649ac4b2e62209d7cf729
Reviewed-on: https://chromium-review.googlesource.com/565415Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46523}
parent ba35cd5f
......@@ -767,7 +767,7 @@ class UploadStep(Step):
reviewer = self.ReadLine()
self.GitUpload(reviewer, self._options.author, self._options.force_upload,
bypass_hooks=self._options.bypass_upload_hooks,
cc=self._options.cc, use_gerrit=not self._options.rietveld)
cc=self._options.cc)
def MakeStep(step_class=Step, number=0, state=None, config=None,
......@@ -813,15 +813,13 @@ class ScriptsBase(object):
def MakeOptions(self, args=None):
parser = argparse.ArgumentParser(description=self._Description())
parser.add_argument("-a", "--author", default="",
help="The author email used for rietveld.")
help="The author email used for code review.")
parser.add_argument("--dry-run", default=False, action="store_true",
help="Perform only read-only actions.")
parser.add_argument("--json-output",
help="File to write results summary to.")
parser.add_argument("-r", "--reviewer", default="",
help="The account name to be used for reviews.")
parser.add_argument("--rietveld", default=False, action="store_true",
help="Whether to use rietveld instead of gerrit.")
parser.add_argument("-s", "--step",
help="Specify the step where to start work. Default: 0.",
default=0, type=int)
......
......@@ -206,8 +206,7 @@ class GitRecipesMixin(object):
self.Git(MakeArgs(args), **kwargs)
def GitUpload(self, reviewer="", author="", force=False, cq=False,
bypass_hooks=False, cc="", use_gerrit=False,
private=False, **kwargs):
bypass_hooks=False, cc="", private=False, **kwargs):
args = ["cl upload --send-mail"]
if author:
args += ["--email", Quoted(author)]
......@@ -221,8 +220,7 @@ class GitRecipesMixin(object):
args.append("--bypass-hooks")
if cc:
args += ["--cc", Quoted(cc)]
if use_gerrit:
args += ["--gerrit"]
args += ["--gerrit"]
if private:
args += ["--private"]
# TODO(machenbach): Check output in forced mode. Verify that all required
......
......@@ -968,7 +968,7 @@ TBR=reviewer@chromium.org"""
Cmd("git commit -aF \"%s\"" % TEST_CONFIG["COMMITMSG_FILE"], "",
cb=CheckVersionCommit),
Cmd("git cl upload --send-mail --email \"author@chromium.org\" "
"-f --bypass-hooks --private", ""),
"-f --bypass-hooks --gerrit --private", ""),
Cmd("git cl land --bypass-hooks -f", ""),
Cmd("git fetch", ""),
Cmd("git log -1 --format=%H --grep="
......@@ -1119,7 +1119,7 @@ deps = {
self.ROLL_COMMIT_MSG),
"", cwd=chrome_dir),
Cmd("git cl upload --send-mail --email \"author@chromium.org\" -f "
"--use-commit-queue --bypass-hooks", "", cwd=chrome_dir),
"--use-commit-queue --bypass-hooks --gerrit", "", cwd=chrome_dir),
Cmd("git checkout -f master", "", cwd=chrome_dir),
Cmd("git branch -D work-branch", "", cwd=chrome_dir),
]
......
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