Commit 680fed02 authored by Filippos Giannakos's avatar Filippos Giannakos
Browse files

Make bump version modular.

Add a _bump version function without any validation checking. Use the new
validate_version to perform the validation.
parent 9b0839dd
......@@ -412,17 +412,9 @@ def bump_version_main():
sys.stdout.write("usage: %s version\n" % sys.argv[0])
def bump_version(new_version):
"""Set new base version to base version file and commit"""
v = utils.get_vcs_info()
mode = utils.get_build_mode()
# Check that new base version is valid
python_version(new_version, v, mode)
def _bump_version(new_version, v):
repo = utils.get_repository()
toplevel = repo.working_dir
old_version = get_base_version(v)
sys.stdout.write("Current base version is '%s'\n" % old_version)
......@@ -445,6 +437,16 @@ def bump_version(new_version):
sys.stdout.write("Update version file and commited\n")
def bump_version(new_version):
"""Set new base version to base version file and commit"""
v = utils.get_vcs_info()
# Check that new base version is valid
validate_version(new_version, v)
_bump_version(new_version, v)
def main():
v = utils.get_vcs_info()
b = get_base_version(v)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment