add --date argument

This commit is contained in:
Manuel Barkhau 2020-10-02 22:43:45 +00:00
parent 67feeaf8ef
commit 7b06012180
4 changed files with 66 additions and 20 deletions

View file

@ -380,6 +380,7 @@ def incr(
patch : bool = False,
release_num: bool = False,
pin_date : bool = False,
date : typ.Optional[dt.date] = None,
) -> typ.Optional[str]:
"""Increment version string.
@ -391,7 +392,7 @@ def incr(
logger.error(str(ex))
return None
cur_cinfo = _ver_to_cal_info(old_vinfo) if pin_date else cal_info()
cur_cinfo = _ver_to_cal_info(old_vinfo) if pin_date else cal_info(date)
if _is_cal_gt(old_vinfo, cur_cinfo):
logger.warning(f"Old version appears to be from the future '{old_version}'")