Add dry-run feature to auto roll scripts.

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

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23633 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 327d2389
......@@ -100,6 +100,8 @@ class RollChromium(Step):
if self._options.sheriff:
args.extend([
"--sheriff", "--googlers-mapping", self._options.googlers_mapping])
if self._options.dry_run:
args.extend(["--dry-run"])
R = chromium_roll.ChromiumRoll
self._side_effect_handler.Call(
R(chromium_roll.CONFIG, self._side_effect_handler).Run,
......@@ -111,8 +113,7 @@ class AutoRoll(ScriptsBase):
parser.add_argument("-c", "--chromium", required=True,
help=("The path to your Chromium src/ "
"directory to automate the V8 roll."))
parser.add_argument("--roll",
help="Make Chromium roll. Dry run if unspecified.",
parser.add_argument("--roll", help="Call Chromium roll script.",
default=False, action="store_true")
def _ProcessOptions(self, options): # pragma: no cover
......
......@@ -87,10 +87,15 @@ class UploadCL(Step):
% self["sheriff"])
self.GitCommit("%s%s\n\nTBR=%s" %
(commit_title, sheriff, self._options.reviewer))
self.GitUpload(author=self._options.author,
force=True,
cq=self._options.use_commit_queue)
print "CL uploaded."
if not self._options.dry_run:
self.GitUpload(author=self._options.author,
force=True,
cq=self._options.use_commit_queue)
print "CL uploaded."
else:
self.GitCheckout("master")
self.GitDeleteBranch("v8-roll-%s" % self["trunk_revision"])
print "Dry run - don't upload."
class SwitchV8(Step):
......
......@@ -592,6 +592,8 @@ class ScriptsBase(object):
parser = argparse.ArgumentParser(description=self._Description())
parser.add_argument("-a", "--author", default="",
help="The author email used for rietveld.")
parser.add_argument("--dry-run", default=False, action="store_true",
help="Perform only read-only actions.")
parser.add_argument("-g", "--googlers-mapping",
help="Path to the script mapping google accounts.")
parser.add_argument("-r", "--reviewer", default="",
......
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