Chromium Code Reviews| Index: tools/push-to-trunk/push_to_trunk.py |
| diff --git a/tools/push-to-trunk/push_to_trunk.py b/tools/push-to-trunk/push_to_trunk.py |
| index 2aa32cd31911603907f4a8ef80148c4a45253cff..5f730ea25f02d02b7e9f74b21c34da160abeed32 100755 |
| --- a/tools/push-to-trunk/push_to_trunk.py |
| +++ b/tools/push-to-trunk/push_to_trunk.py |
| @@ -135,8 +135,10 @@ class EditChangeLog(Step): |
| print ("Please press <Return> to have your EDITOR open the ChangeLog " |
| "entry, then edit its contents to your liking. When you're done, " |
| "save the file and exit your EDITOR. ") |
| - self.ReadLine() |
| + self.ReadLine(default="") |
| + # TODO(machenbach): Don't use EDITOR in forced mode as soon as script is |
| + # well tested. |
| self.Editor(self.Config(CHANGELOG_ENTRY_FILE)) |
| handle, new_changelog = tempfile.mkstemp() |
| os.close(handle) |
| @@ -354,6 +356,7 @@ class CommitSVN(Step): |
| print("Sorry, grepping for the SVN revision failed. Please look for it " |
| "in the last command's output above and provide it manually (just " |
| "the number, without the leading \"r\").") |
| + self.DieInFocedMode("Can't prompt in forced mode.") |
| while not trunk_revision: |
| print "> ", |
| trunk_revision = self.ReadLine() |
| @@ -380,6 +383,8 @@ class CheckChromium(Step): |
| def Run(self): |
| chrome_path = self._options.c |
| if not chrome_path: |
| + self.DieInFocedMode("Please specify the path to a Chromium checkout in " |
|
Jakob Kummerow
2013/11/19 13:46:11
Wouldn't it make more sense to skip the entire Chr
Michael Achenbach
2013/11/19 15:09:37
I assumed that part should be automatized as well.
|
| + "forced mode.") |
| print ("Do you have a \"NewGit\" Chromium checkout and want " |
| "this script to automate creation of the roll CL? If yes, enter the " |
| "path to (and including) the \"src\" directory here, otherwise just " |
| @@ -442,8 +447,13 @@ class UploadCL(Step): |
| ver = "%s.%s.%s" % (self._state["major"], |
| self._state["minor"], |
| self._state["build"]) |
| - print "Please enter the email address of a reviewer for the roll CL: ", |
| - rev = self.ReadLine() |
| + if self._options and self._options.r: |
| + print "Using account %s for review." % self._options.r |
| + rev = self._options.r |
| + else: |
| + print "Please enter the email address of a reviewer for the roll CL: ", |
| + self.DieInFocedMode("A reviewer must be specified in forced mode.") |
| + rev = self.ReadLine() |
| args = "commit -am \"Update V8 to version %s.\n\nTBR=%s\"" % (ver, rev) |
| if self.Git(args) is None: |
| self.Die("'git commit' failed.") |
| @@ -523,15 +533,20 @@ def RunPushToTrunk(config, |
| def BuildOptions(): |
| result = optparse.OptionParser() |
| - result.add_option("-s", "--step", dest="s", |
| - help="Specify the step where to start work. Default: 0.", |
| - default=0, type="int") |
| - result.add_option("-l", "--last-push", dest="l", |
| - help=("Manually specify the git commit ID " |
| - "of the last push to trunk.")) |
| result.add_option("-c", "--chromium", dest="c", |
| help=("Specify the path to your Chromium src/ " |
| "directory to automate the V8 roll.")) |
| + result.add_option("-f", "--force", dest="f", |
| + help="Don't promt to the user.", |
|
Jakob Kummerow
2013/11/19 13:46:11
s/promt to/prompt/
Michael Achenbach
2013/11/19 15:09:37
Done.
|
| + default=False, action="store_true") |
| + result.add_option("-l", "--last-push", dest="l", |
| + help=("Manually specify the git commit ID " |
| + "of the last push to trunk.")) |
| + result.add_option("-r", "--reviewer", dest="r", |
| + help=("Specify the account name to be used for reviews.")) |
| + result.add_option("-s", "--step", dest="s", |
| + help="Specify the step where to start work. Default: 0.", |
| + default=0, type="int") |
| return result |