| 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 """ | 6 """ |
| 7 Script for auto-increasing the version on bleeding_edge. | 7 Script for auto-increasing the version on bleeding_edge. |
| 8 | 8 |
| 9 The script can be run regularly by a cron job. It will increase the build | 9 The script can be run regularly by a cron job. It will increase the build |
| 10 level of the version on bleeding_edge if: | 10 level of the version on bleeding_edge if: |
| 11 - the lkgr version is smaller than the version of the latest revision, | 11 - the lkgr version is smaller than the version of the latest revision, |
| 12 - the lkgr version is not a version change itself, | 12 - the lkgr version is not a version change itself, |
| 13 - the tree is not closed for maintenance. | 13 - the tree is not closed for maintenance. |
| 14 | 14 |
| 15 The new version will be the maximum of the bleeding_edge and trunk versions +1. | 15 The new version will be the maximum of the bleeding_edge and trunk versions +1. |
| 16 E.g. latest bleeding_edge version: 3.22.11.0 and latest trunk 3.23.0.0 gives | 16 E.g. latest bleeding_edge version: 3.22.11.0 and latest trunk 3.23.0.0 gives |
| 17 the new version 3.23.1.0. | 17 the new version 3.23.1.0. |
| 18 | 18 |
| 19 This script requires a depot tools git checkout. I.e. 'fetch v8'. | 19 This script requires a depot tools git checkout. I.e. 'fetch v8'. |
| 20 """ | 20 """ |
| 21 | 21 |
| 22 import argparse | 22 import argparse |
| 23 import os | 23 import os |
| 24 import sys | 24 import sys |
| 25 | 25 |
| 26 from common_includes import * | 26 from common_includes import * |
| 27 | 27 |
| 28 CONFIG = { | 28 CONFIG = { |
| 29 PERSISTFILE_BASENAME: "/tmp/v8-bump-up-version-tempfile", | 29 PERSISTFILE_BASENAME: "/tmp/v8-bump-up-version-tempfile", |
| 30 PATCH_FILE: "/tmp/v8-bump-up-version-tempfile-patch-file", |
| 30 VERSION_FILE: "src/version.cc", | 31 VERSION_FILE: "src/version.cc", |
| 31 } | 32 } |
| 32 | 33 |
| 33 VERSION_BRANCH = "auto-bump-up-version" | 34 VERSION_BRANCH = "auto-bump-up-version" |
| 34 | 35 |
| 35 | 36 |
| 36 class Preparation(Step): | 37 class Preparation(Step): |
| 37 MESSAGE = "Preparation." | 38 MESSAGE = "Preparation." |
| 38 | 39 |
| 39 def RunStep(self): | 40 def RunStep(self): |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 190 |
| 190 class ChangeVersion(Step): | 191 class ChangeVersion(Step): |
| 191 MESSAGE = "Bump up the version." | 192 MESSAGE = "Bump up the version." |
| 192 | 193 |
| 193 def RunStep(self): | 194 def RunStep(self): |
| 194 self.GitCreateBranch(VERSION_BRANCH, "bleeding_edge") | 195 self.GitCreateBranch(VERSION_BRANCH, "bleeding_edge") |
| 195 | 196 |
| 196 self.SetVersion(self.Config(VERSION_FILE), "new_") | 197 self.SetVersion(self.Config(VERSION_FILE), "new_") |
| 197 | 198 |
| 198 try: | 199 try: |
| 199 self.GitCommit("[Auto-roll] Bump up version to %s\n\nTBR=%s" % | 200 msg = "[Auto-roll] Bump up version to %s" % self["new_version"] |
| 200 (self["new_version"], self._options.author)) | 201 self.GitCommit("%s\n\nTBR=%s" % (msg, self._options.author), |
| 201 self.GitUpload(author=self._options.author, | 202 author=self._options.author) |
| 202 force=self._options.force_upload, | 203 if self._options.svn: |
| 203 bypass_hooks=True) | 204 self.SVNCommit("branches/bleeding_edge", msg) |
| 204 self.GitDCommit() | 205 else: |
| 206 self.GitUpload(author=self._options.author, |
| 207 force=self._options.force_upload, |
| 208 bypass_hooks=True) |
| 209 self.GitDCommit() |
| 205 print "Successfully changed the version." | 210 print "Successfully changed the version." |
| 206 finally: | 211 finally: |
| 207 # Clean up. | 212 # Clean up. |
| 208 self.GitCheckout("bleeding_edge") | 213 self.GitCheckout("bleeding_edge") |
| 209 self.DeleteBranch(VERSION_BRANCH) | 214 self.DeleteBranch(VERSION_BRANCH) |
| 210 | 215 |
| 211 | 216 |
| 212 class BumpUpVersion(ScriptsBase): | 217 class BumpUpVersion(ScriptsBase): |
| 213 def _PrepareOptions(self, parser): | 218 def _PrepareOptions(self, parser): |
| 214 parser.add_argument("--dry_run", help="Don't commit the new version.", | 219 parser.add_argument("--dry_run", help="Don't commit the new version.", |
| (...skipping 17 matching lines...) Expand all Loading... |
| 232 GetLKGRVersion, | 237 GetLKGRVersion, |
| 233 LKGRVersionUpToDateBailout, | 238 LKGRVersionUpToDateBailout, |
| 234 GetTrunkVersion, | 239 GetTrunkVersion, |
| 235 CalculateVersion, | 240 CalculateVersion, |
| 236 CheckTreeStatus, | 241 CheckTreeStatus, |
| 237 ChangeVersion, | 242 ChangeVersion, |
| 238 ] | 243 ] |
| 239 | 244 |
| 240 if __name__ == "__main__": # pragma: no cover | 245 if __name__ == "__main__": # pragma: no cover |
| 241 sys.exit(BumpUpVersion(CONFIG).Run()) | 246 sys.exit(BumpUpVersion(CONFIG).Run()) |
| OLD | NEW |