INNER CODE UNIT · Python
get_next_minor
mongodb/mongo-cxx-driver · etc/calc_release_version.py:175
def get_next_minor(prerelease_marker): # type: (str) -> str
"""
get_next_minor does the following:
- Inspect the branches that fit the convention for a release branch.
- Choose the latest and increment the minor version.
- Append .0 to form the new version (e.g., releases/v3.6 becomes 3.7.0)
- Append a pre-release marker. (e.g. 3.7.0 becomes 3.7.0-20220201+gitf6e6a7025d)
"""
version_str = '0.0.0'
version_parsed = parse_version(version_str)
version_new = {}
# Use refs (not branches) to get local branches plus remote branches
refs = check_output(['git', 'show-ref']).splitlines()
for ref in refs:
release_branch_match = RELEASE_BRANCH_RE.match(ref.split()[1])
if release_branch_match: