Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 the V8 project authors. All rights reserved. | 2 # Copyright 2014 the V8 project authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import argparse | 6 import argparse |
| 7 import os | 7 import os |
| 8 import sys | 8 import sys |
| 9 | 9 |
| 10 from common_includes import * | 10 from common_includes import * |
| 11 | 11 |
| 12 | 12 |
| 13 ROLL_SUMMARY = ("Summary of changes available at:\n" | |
| 14 "https://chromium.googlesource.com/v8/v8/+log/%s..%s") | |
| 15 | |
| 16 | |
| 13 class Preparation(Step): | 17 class Preparation(Step): |
| 14 MESSAGE = "Preparation." | 18 MESSAGE = "Preparation." |
| 15 | 19 |
| 16 def RunStep(self): | 20 def RunStep(self): |
| 17 # Update v8 remote tracking branches. | 21 # Update v8 remote tracking branches. |
| 18 self.GitFetchOrigin() | 22 self.GitFetchOrigin() |
| 19 | 23 |
| 20 | 24 |
| 21 class DetectLastPush(Step): | 25 class DetectLastPush(Step): |
| 22 MESSAGE = "Detect commit ID of last release." | 26 MESSAGE = "Detect commit ID of last release." |
| 23 | 27 |
| 24 def RunStep(self): | 28 def RunStep(self): |
| 25 # The revision that should be rolled. | 29 # The revision that should be rolled. |
| 26 self["last_push"] = self._options.last_push or self.GetLatestRelease() | 30 self["last_push"] = self._options.last_push or self.GetLatestRelease() |
| 27 self["push_title"] = self.GitLog(n=1, format="%s", | 31 self["push_title"] = self.GitLog(n=1, format="%s", |
| 28 git_hash=self["last_push"]) | 32 git_hash=self["last_push"]) |
| 29 | 33 |
| 34 # The master revision this release is based on. | |
| 35 self["push_base"] = self.GetLatestReleaseBase() | |
| 36 | |
| 37 # FIXME(machenbach): Manually specifying a revision doesn't work at the | |
| 38 # moment. Needs more complicated logic to find the correct push_base above. | |
| 39 # Maybe delete that parameter entirely? | |
|
tandrii(chromium)
2015/02/13 22:29:08
+1 for deleting it based on this rational, yet I d
Michael Achenbach
2015/02/16 12:20:28
Some weird historical stuff. Probably needed if a
| |
| 40 assert not self._options.last_push | |
| 41 | |
| 42 # Determine the master revision of the last roll. | |
| 43 version = self.GetVersionTag(self._options.last_roll) | |
| 44 assert version | |
| 45 self["last_rolled_base"] = self.GetLatestReleaseBase(version=version) | |
| 46 assert self["last_rolled_base"] | |
| 47 | |
| 30 | 48 |
| 31 class SwitchChromium(Step): | 49 class SwitchChromium(Step): |
| 32 MESSAGE = "Switch to Chromium checkout." | 50 MESSAGE = "Switch to Chromium checkout." |
| 33 | 51 |
| 34 def RunStep(self): | 52 def RunStep(self): |
| 35 self["v8_path"] = os.getcwd() | 53 self["v8_path"] = os.getcwd() |
| 36 cwd = self._options.chromium | 54 cwd = self._options.chromium |
| 37 os.chdir(cwd) | 55 os.chdir(cwd) |
| 38 self.InitialEnvironmentChecks(cwd) | 56 self.InitialEnvironmentChecks(cwd) |
| 39 # Check for a clean workdir. | 57 # Check for a clean workdir. |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 62 class UploadCL(Step): | 80 class UploadCL(Step): |
| 63 MESSAGE = "Create and upload CL." | 81 MESSAGE = "Create and upload CL." |
| 64 | 82 |
| 65 def RunStep(self): | 83 def RunStep(self): |
| 66 # Patch DEPS file. | 84 # Patch DEPS file. |
| 67 if self.Command( | 85 if self.Command( |
| 68 "roll-dep", "v8 %s" % self["last_push"], | 86 "roll-dep", "v8 %s" % self["last_push"], |
| 69 cwd=self._options.chromium) is None: | 87 cwd=self._options.chromium) is None: |
| 70 self.Die("Failed to create deps for %s" % self["last_push"]) | 88 self.Die("Failed to create deps for %s" % self["last_push"]) |
| 71 | 89 |
| 72 commit_title = "Update V8 to %s." % self["push_title"].lower() | 90 message = [] |
| 73 sheriff = "" | 91 message.append("Update V8 to %s." % self["push_title"].lower()) |
| 92 | |
| 93 message.append( | |
| 94 ROLL_SUMMARY % (self["last_rolled_base"][:8], self["push_base"][:8])) | |
|
tandrii(chromium)
2015/02/13 22:29:08
8chars*4bits = 32 bits should be enough for everyb
Michael Achenbach
2015/02/16 12:20:28
I actually ran a test once over our repo and found
tandrii(chromium)
2015/02/16 14:32:28
So, I actually had some fun with this Birthday's p
Jakob Kummerow
2015/02/16 19:54:55
Just give it 12 chars or so (or 20, I don't care),
| |
| 95 | |
| 74 if self["sheriff"]: | 96 if self["sheriff"]: |
| 75 sheriff = ("\n\nPlease reply to the V8 sheriff %s in case of problems." | 97 message.append("Please reply to the V8 sheriff %s in case of problems." |
| 76 % self["sheriff"]) | 98 % self["sheriff"]) |
| 77 self.GitCommit("%s%s\n\nTBR=%s" % | 99 message.append("TBR=%s" % self._options.reviewer) |
| 78 (commit_title, sheriff, self._options.reviewer), | 100 self.GitCommit("\n\n".join(message), |
| 79 author=self._options.author, | 101 author=self._options.author, |
| 80 cwd=self._options.chromium) | 102 cwd=self._options.chromium) |
| 81 if not self._options.dry_run: | 103 if not self._options.dry_run: |
| 82 self.GitUpload(author=self._options.author, | 104 self.GitUpload(author=self._options.author, |
| 83 force=True, | 105 force=True, |
| 84 cq=self._options.use_commit_queue, | 106 cq=self._options.use_commit_queue, |
| 85 cwd=self._options.chromium) | 107 cwd=self._options.chromium) |
| 86 print "CL uploaded." | 108 print "CL uploaded." |
| 87 else: | 109 else: |
| 88 self.GitCheckout("master", cwd=self._options.chromium) | 110 self.GitCheckout("master", cwd=self._options.chromium) |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 112 Command("rm", "-f %s*" % self._config["PERSISTFILE_BASENAME"]) | 134 Command("rm", "-f %s*" % self._config["PERSISTFILE_BASENAME"]) |
| 113 | 135 |
| 114 | 136 |
| 115 class ChromiumRoll(ScriptsBase): | 137 class ChromiumRoll(ScriptsBase): |
| 116 def _PrepareOptions(self, parser): | 138 def _PrepareOptions(self, parser): |
| 117 parser.add_argument("-c", "--chromium", required=True, | 139 parser.add_argument("-c", "--chromium", required=True, |
| 118 help=("The path to your Chromium src/ " | 140 help=("The path to your Chromium src/ " |
| 119 "directory to automate the V8 roll.")) | 141 "directory to automate the V8 roll.")) |
| 120 parser.add_argument("-l", "--last-push", | 142 parser.add_argument("-l", "--last-push", |
| 121 help="The git commit ID of the last candidates push.") | 143 help="The git commit ID of the last candidates push.") |
| 144 parser.add_argument("--last-roll", required=True, | |
| 145 help="The git commit ID of the last rolled version.") | |
| 122 parser.add_argument("--use-commit-queue", | 146 parser.add_argument("--use-commit-queue", |
| 123 help="Check the CQ bit on upload.", | 147 help="Check the CQ bit on upload.", |
| 124 default=False, action="store_true") | 148 default=False, action="store_true") |
| 125 | 149 |
| 126 def _ProcessOptions(self, options): # pragma: no cover | 150 def _ProcessOptions(self, options): # pragma: no cover |
| 127 if not options.author or not options.reviewer: | 151 if not options.author or not options.reviewer: |
| 128 print "A reviewer (-r) and an author (-a) are required." | 152 print "A reviewer (-r) and an author (-a) are required." |
| 129 return False | 153 return False |
| 130 | 154 |
| 131 options.requires_editor = False | 155 options.requires_editor = False |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 146 SwitchChromium, | 170 SwitchChromium, |
| 147 UpdateChromiumCheckout, | 171 UpdateChromiumCheckout, |
| 148 UploadCL, | 172 UploadCL, |
| 149 SwitchV8, | 173 SwitchV8, |
| 150 CleanUp, | 174 CleanUp, |
| 151 ] | 175 ] |
| 152 | 176 |
| 153 | 177 |
| 154 if __name__ == "__main__": # pragma: no cover | 178 if __name__ == "__main__": # pragma: no cover |
| 155 sys.exit(ChromiumRoll().Run()) | 179 sys.exit(ChromiumRoll().Run()) |
| OLD | NEW |