def build_version_string(cfg, repo, promote=False, next_custom=None):
    in_next = repo['count'] > 0
    has_next_custom = next_custom is not None and len(next_custom) > 0

    if promote:
        if has_next_custom:
            # simulates next real version after proper tagging
            version = next_custom
            return version
        else:
            return ''

    fmt = cfg['format'] if not in_next else cfg['format_next']
    return fmt % build_format_args(cfg, repo, next_custom)


#
# commands
#
Builds the final version string by processing the specified repository
dataset/ETHPy150Open manuelbua/gitver/gitver/commands.py/build_version_string