def checkout(proj_dir, revision) :
    try :
        output = subprocess.check_output('git checkout {}'.format(revision), cwd=proj_dir, shell=True)
        return output.split(':')[0] != 'error'
    except subprocess.CalledProcessError :
        log.error("failed to call 'git checkout'")
        return None

#-------------------------------------------------------------------------------
checkout a specific revision hash of a repository
dataset/ETHPy150Open floooh/fips/mod/tools/git.py/checkout