Force 'git cl upload' in push-to-trunk forced mode.

R=jkummerow@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17926 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
machenbach@chromium.org 2013-11-20 13:53:11 +00:00
parent df38e6f9a6
commit 718b38648f
3 changed files with 12 additions and 6 deletions

View File

@ -370,15 +370,18 @@ class UploadStep(Step):
Step.__init__(self, "Upload for code review.")
def RunStep(self):
if self._options and self._options.r:
if self._options.r:
print "Using account %s for review." % self._options.r
reviewer = self._options.r
else:
print "Please enter the email address of a V8 reviewer for your patch: ",
self.DieInForcedMode("A reviewer must be specified in forced mode.")
reviewer = self.ReadLine()
args = "cl upload -r \"%s\" --send-mail" % reviewer
if self.Git(args,pipe=False) is None:
force_flag = " -f" if self._options.f else ""
args = "cl upload -r \"%s\" --send-mail%s" % (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:
self.Die("'git cl upload' failed, please try again.")

View File

@ -457,7 +457,8 @@ class UploadCL(Step):
args = "commit -am \"Update V8 to version %s.\n\nTBR=%s\"" % (ver, rev)
if self.Git(args) is None:
self.Die("'git commit' failed.")
if self.Git("cl upload --send-mail", pipe=False) is None:
force_flag = " -f" if self._options.f else ""
if self.Git("cl upload --send-mail%s" % force_flag, pipe=False) is None:
self.Die("'git cl upload' failed, please try again.")
print "CL uploaded."

View File

@ -461,6 +461,7 @@ class ScriptTest(unittest.TestCase):
self.assertTrue(re.search(r"#define PATCH_LEVEL\s+0", version))
self.assertTrue(re.search(r"#define IS_CANDIDATE_VERSION\s+0", version))
force_flag = " -f" if force else ""
self._git_recipe = [
["status -s -uno", ""],
["status -s -b -uno", "## some_branch\n"],
@ -481,7 +482,8 @@ class ScriptTest(unittest.TestCase):
"Now working on version 3.22.6.\""),
" 2 files changed\n",
CheckPreparePush],
["cl upload -r \"reviewer@chromium.org\" --send-mail", "done\n"],
["cl upload -r \"reviewer@chromium.org\" --send-mail%s" % force_flag,
"done\n"],
["cl dcommit -f", "Closing issue\n"],
["svn fetch", "fetch result\n"],
["checkout svn/bleeding_edge", ""],
@ -502,7 +504,7 @@ class ScriptTest(unittest.TestCase):
[("commit -am \"Update V8 to version 3.22.5.\n\n"
"TBR=reviewer@chromium.org\""),
""],
["cl upload --send-mail", ""],
["cl upload --send-mail%s" % force_flag, ""],
["checkout -f some_branch", ""],
["branch -D %s" % TEST_CONFIG[TEMP_BRANCH], ""],
["branch -D %s" % TEST_CONFIG[BRANCHNAME], ""],