INNER CODE UNIT · Python

get_branch_tags

mongodb/mongo-cxx-driver · etc/calc_release_version.py:211

def get_branch_tags(active_branch_name):  # type: (str) -> list[str]
    """
    Returns a list of tags corresponding to the current branch, which must not
    be master.  If the specified branch is a release branch then return all tags
    based on the major/minor X.Y release version.  If the specified branch is
    neither master nor a release branch, then walk backwards in history until
    the first tag matching the glob 'r*' and return that tag.
    """

    debug('Getting tags for branch {0}'.format(active_branch_name))
    if active_branch_name == 'master':
        raise Exception('this method is not meant to be called while on "master"')

    release_branch_match = RELEASE_BRANCH_RE.match(active_branch_name)
    if release_branch_match:
        # This is a release branch, so look for tags only on this branch
        tag_glob = 'r' + release_branch_match.group('vermaj') + '.' \
                + release_branch_match.group('vermin') + '.*'

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…