add --release-num cli flag

This commit is contained in:
Manuel Barkhau 2020-09-24 20:34:03 +00:00
parent ada75ade8a
commit b7cb2855f0
5 changed files with 45 additions and 24 deletions

View file

@ -378,6 +378,7 @@ def incr(
major : bool = False,
minor : bool = False,
patch : bool = False,
release_num: bool = False,
pin_date: bool = False,
) -> typ.Optional[str]:
"""Increment version string.
@ -400,14 +401,16 @@ def incr(
cur_vinfo = cur_vinfo._replace(bid=lexid.next_id(cur_vinfo.bid))
if release:
cur_vinfo = cur_vinfo._replace(tag=release)
if major:
cur_vinfo = cur_vinfo._replace(major=cur_vinfo.major + 1, minor=0, patch=0)
if minor:
cur_vinfo = cur_vinfo._replace(minor=cur_vinfo.minor + 1, patch=0)
if patch:
cur_vinfo = cur_vinfo._replace(patch=cur_vinfo.patch + 1)
if release_num:
cur_vinfo = cur_vinfo._replace(num=cur_vinfo.num + 1)
if release:
cur_vinfo = cur_vinfo._replace(tag=release)
new_version = format_version(cur_vinfo, raw_pattern)
if new_version == old_version: