from common_includes import *
-CONFIG = {
- PERSISTFILE_BASENAME: "/tmp/v8-bump-up-version-tempfile",
- VERSION_FILE: "src/version.cc",
-}
-
VERSION_BRANCH = "auto-bump-up-version"
MESSAGE = "Stop script if the last change modified the version."
def RunStep(self):
- if self._config[VERSION_FILE] in self.GitChangedFiles(self["latest"]):
+ if VERSION_FILE in self.GitChangedFiles(self["latest"]):
print "Stop due to recent version change."
return True
def RunStep(self):
# If a version-change commit becomes the lkgr, don't bump up the version
# again.
- if self._config[VERSION_FILE] in self.GitChangedFiles(self["lkgr"]):
+ if VERSION_FILE in self.GitChangedFiles(self["lkgr"]):
print "Stop because the lkgr is a version change itself."
return True
def RunStep(self):
self.GitCreateBranch(VERSION_BRANCH, "bleeding_edge")
- self.SetVersion(self.Config(VERSION_FILE), "new_")
+ self.SetVersion(os.path.join(self.default_cwd, VERSION_FILE), "new_")
try:
- self.GitCommit("[Auto-roll] Bump up version to %s\n\nTBR=%s" %
- (self["new_version"], self._options.author))
- self.GitUpload(author=self._options.author,
- force=self._options.force_upload,
- bypass_hooks=True)
- self.GitDCommit()
+ msg = "[Auto-roll] Bump up version to %s" % self["new_version"]
+ self.GitCommit("%s\n\nTBR=%s" % (msg, self._options.author),
+ author=self._options.author)
+ if self._options.svn:
+ self.SVNCommit("branches/bleeding_edge", msg)
+ else:
+ self.GitUpload(author=self._options.author,
+ force=self._options.force_upload,
+ bypass_hooks=True)
+ self.GitDCommit()
print "Successfully changed the version."
finally:
# Clean up.
options.force_upload = True
return True
+ def _Config(self):
+ return {
+ "PERSISTFILE_BASENAME": "/tmp/v8-bump-up-version-tempfile",
+ }
+
def _Steps(self):
return [
Preparation,
]
if __name__ == "__main__": # pragma: no cover
- sys.exit(BumpUpVersion(CONFIG).Run())
+ sys.exit(BumpUpVersion().Run())