コード例 #1
0
ファイル: version.py プロジェクト: HereticSK/fms
def get_version():
    """
    Return current version number.
    Version number is :
    - last tag number if last commit == last tag and repo is clean 
      or not a git repo (regular fms install)
    - get_full_version() otherwise
    """
    from fms.utils.git import get_git_commit_hash, is_git_repo, is_repo_clean
    if is_git_repo():
        if is_repo_clean():
            if get_git_commit_hash() == get_git_commit_hash(TAG):
                return TAG
        return get_full_version()
    else:
        return TAG
コード例 #2
0
def get_version():
    """
    Return current version number.
    Version number is :
    - last tag number if last commit == last tag and repo is clean 
      or not a git repo (regular fms install)
    - get_full_version() otherwise
    """
    from fms.utils.git import get_git_commit_hash, is_git_repo, is_repo_clean
    if is_git_repo():
        if is_repo_clean():
            if get_git_commit_hash() == get_git_commit_hash(TAG):
                return TAG
        return get_full_version()
    else:
        return TAG
コード例 #3
0
ファイル: version.py プロジェクト: HereticSK/fms
def get_full_version():
    """
    Return full version number
    
    The full version includes last commit reference if any,
    i.e. if we run from a git repository.
    """
    from fms.utils.git import get_git_commit_hash, is_repo_clean, is_git_repo
    version = TAG
    if not is_git_repo():
        return version
    git_commit = get_git_commit_hash()[:8]
    if git_commit:
        version = "%s-%s" % (version, git_commit)
        if not is_repo_clean():
            version = "%s-dirty" % version
    return version
コード例 #4
0
def get_full_version():
    """
    Return full version number
    
    The full version includes last commit reference if any,
    i.e. if we run from a git repository.
    """
    from fms.utils.git import get_git_commit_hash, is_repo_clean, is_git_repo
    version = TAG
    if not is_git_repo():
        return version
    git_commit = get_git_commit_hash()[:8]
    if git_commit:
        version = "%s-%s" % (version, git_commit)
        if not is_repo_clean():
            version = "%s-dirty" % version
    return version