From: machenbach@chromium.org Date: Wed, 20 Nov 2013 13:53:11 +0000 (+0000) Subject: Force 'git cl upload' in push-to-trunk forced mode. X-Git-Tag: upstream/4.7.83~11638 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=718b38648f6235e7f0405fe866649f9b12d870b9;p=platform%2Fupstream%2Fv8.git 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 --- diff --git a/tools/push-to-trunk/common_includes.py b/tools/push-to-trunk/common_includes.py index 9547367..14f130b 100644 --- a/tools/push-to-trunk/common_includes.py +++ b/tools/push-to-trunk/common_includes.py @@ -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.") diff --git a/tools/push-to-trunk/push_to_trunk.py b/tools/push-to-trunk/push_to_trunk.py index c8fdc7e..8b763f5 100755 --- a/tools/push-to-trunk/push_to_trunk.py +++ b/tools/push-to-trunk/push_to_trunk.py @@ -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." diff --git a/tools/push-to-trunk/test_scripts.py b/tools/push-to-trunk/test_scripts.py index 6ce22de..a833709 100644 --- a/tools/push-to-trunk/test_scripts.py +++ b/tools/push-to-trunk/test_scripts.py @@ -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], ""],