(vcs, reporoot, untracked_is_dirty=False)
return (rev, dirty)
return the current revision of the repository and whether the working
    directory is clean. returns None if repo info cannot be fetched.
    untracked_is_dirty -- whether the presence of untracked files in the
      working directory is counted as 'not clean
return the current revision of the repository and whether the working
    directory is clean. returns None if repo info cannot be fetched.
    untracked_is_dirty -- whether the presence of untracked files in the
      working directory is counted as 'not clean
return the current revision of the repository and whether the working directory is clean . returns None if repo info cannot be fetched . untracked_is_dirty -- whether the presence of untracked files in the working directory is counted as not clean
def get_raw_revision(vcs, reporoot, untracked_is_dirty=False):
    """return the current revision of the repository and whether the working
    directory is clean. returns None if repo info cannot be fetched.
    untracked_is_dirty -- whether the presence of untracked files in the
      working directory is counted as 'not clean'"""
    REV_HASH_LENGTH = 12

    funcs = {
        'git': {
            'rev': git_raw_revision,
            'dirty': git_is_dirty,
        },
        'hg': {
            'rev': hg_raw_revision,
            'dirty': hg_is_dirty,
        }
    }
    
    exec_ = lambda cmd: shell_exec(cmd, reporoot)

    rev = funcs[vcs]['rev'](exec_)
    if rev:
        rev = rev[0].strip()[:REV_HASH_LENGTH].lower()
    if not rev:
        return None

    dirty = funcs[vcs]['dirty'](exec_, not untracked_is_dirty)
    return (rev, dirty)
def get_raw_revision ( vcs , reporoot , untracked_is_dirty = False ) : REV_HASH_LENGTH = 12 funcs = { 'git' : { 'rev' : git_raw_revision , 'dirty' : git_is_dirty , } , 'hg' : { 'rev' : hg_raw_revision , 'dirty' : hg_is_dirty , } } exec_ = lambda cmd : shell_exec ( cmd , reporoot ) rev = funcs [ vcs ] [ 'rev' ] ( exec_ ) if rev : rev = rev [ 0 ] . strip ( ) [ : REV_HASH_LENGTH ] . lower ( ) if not rev : return None dirty = funcs [ vcs ] [ 'dirty' ] ( exec_ , not untracked_is_dirty ) return ( rev , dirty )