self.r = options.r
self.c = options.c
self.push = getattr(options, 'push', False)
+ self.author = getattr(options, 'a', None)
class Preparation(Step):
print "ToT (r%d) is clean. Pushing to trunk." % latest
self.PushTreeStatus("Tree is closed (preparing to push)")
- # TODO(machenbach): Call push to trunk script.
# TODO(machenbach): Update the script before calling it.
try:
if self._options.push:
self._side_effect_handler.Call(
RunPushToTrunk,
push_to_trunk.CONFIG,
- PushToTrunkOptions.MakeForcedOptions(self._options.r,
+ PushToTrunkOptions.MakeForcedOptions(self._options.author,
+ self._options.r,
self._options.c),
self._side_effect_handler)
finally:
def BuildOptions():
result = optparse.OptionParser()
+ result.add_option("-a", "--author", dest="a",
+ help=("Specify the author email used for rietveld."))
result.add_option("-c", "--chromium", dest="c",
help=("Specify the path to your Chromium src/ "
"directory to automate the V8 roll."))
def Main():
parser = BuildOptions()
(options, args) = parser.parse_args()
- if not options.c or not options.r:
- print "You need to specify the chromium src location and a reviewer."
+ if not options.a or not options.c or not options.r:
+ print "You need to specify author, chromium src location and reviewer."
parser.print_help()
return 1
RunAutoRoll(CONFIG, AutoRollOptions(options))
self.force_readline_defaults = not manual
self.force_upload = not manual
self.manual = manual
+ self.author = getattr(options, 'a', None)
class Step(object):
print "Please enter the email address of a V8 reviewer for your patch: ",
self.DieNoManualMode("A reviewer must be specified in forced mode.")
reviewer = self.ReadLine()
+ author_option = self._options.author
+ author = " --email \"%s\"" % author_option if author_option else ""
force_flag = " -f" if self._options.force_upload else ""
- args = "cl upload -r \"%s\" --send-mail%s" % (reviewer, force_flag)
+ args = ("cl upload%s -r \"%s\" --send-mail%s"
+ % (author, reviewer, force_flag))
# TODO(machenbach): Check output in forced mode. Verify that all required
# base files were uploaded, if not retry.
if self.Git(args, pipe=False) is None:
class PushToTrunkOptions(CommonOptions):
@staticmethod
- def MakeForcedOptions(reviewer, chrome_path):
+ def MakeForcedOptions(author, reviewer, chrome_path):
"""Convenience wrapper."""
class Options(object):
pass
options.m = False
options.r = reviewer
options.c = chrome_path
+ options.a = author
return PushToTrunkOptions(options)
def __init__(self, options):
self.l = options.l
self.r = options.r
self.c = options.c
+ self.author = getattr(options, 'a', None)
class Preparation(Step):
MESSAGE = "Preparation."
% (ver, self._state["svn_revision"], rev))
if self.Git(args) is None:
self.Die("'git commit' failed.")
+ author_option = self._options.author
+ author = " --email \"%s\"" % author_option if author_option else ""
force_flag = " -f" if self._options.force_upload else ""
- if self.Git("cl upload --send-mail%s" % force_flag, pipe=False) is None:
+ if self.Git("cl upload%s --send-mail%s" % (author, force_flag),
+ pipe=False) is None:
self.Die("'git cl upload' failed, please try again.")
print "CL uploaded."
def BuildOptions():
result = optparse.OptionParser()
+ result.add_option("-a", "--author", dest="a",
+ help=("Specify the author email used for rietveld."))
result.add_option("-c", "--chromium", dest="c",
help=("Specify the path to your Chromium src/ "
"directory to automate the V8 roll."))
if not options.m and not options.c:
print "A chromium checkout (-c) is required in (semi-)automatic mode."
return False
+ if not options.m and not options.a:
+ print "Specify your chromium.org email with -a in (semi-)automatic mode."
+ return False
return True
}
-def MakeOptions(s=0, l=None, f=False, m=True, r=None, c=None,
+def MakeOptions(s=0, l=None, f=False, m=True, r=None, c=None, a=None,
status_password=None):
"""Convenience wrapper."""
class Options(object):
options.m = m
options.r = r
options.c = c
+ options.a = a
options.status_password = status_password
return options
"Now working on version 3.22.6.%s\"" % review_suffix),
" 2 files changed\n",
CheckPreparePush],
- ["cl upload -r \"reviewer@chromium.org\" --send-mail%s" % force_flag,
+ [("cl upload --email \"author@chromium.org\" "
+ "-r \"reviewer@chromium.org\" --send-mail%s" % force_flag),
"done\n"],
["cl presubmit", "Presubmit successfull\n"],
["cl dcommit -f --bypass-hooks", "Closing issue\n"],
"(based on bleeding_edge revision r123455).\n\n"
"TBR=reviewer@chromium.org\""),
""],
- ["cl upload --send-mail%s" % force_flag, ""],
+ ["cl upload --email \"author@chromium.org\" --send-mail%s" % force_flag,
+ ""],
["checkout -f some_branch", ""],
["branch -D %s" % TEST_CONFIG[TEMP_BRANCH], ""],
["branch -D %s" % TEST_CONFIG[BRANCHNAME], ""],
if force:
self.ExpectReadline([])
- options = MakeOptions(f=force, m=manual,
+ options = MakeOptions(f=force, m=manual, a="author@chromium.org",
r="reviewer@chromium.org" if not manual else None,
c = TEST_CONFIG[CHROMIUM])
RunPushToTrunk(TEST_CONFIG, PushToTrunkOptions(options), self)