def create_archive():
    ravello_dir = util.get_ravello_dir()
    try:
        st = os.stat(ravello_dir)
    except OSError:
        st = None
    if st and not stat.S_ISDIR(st.st_mode):
        error.raise_error("Path `{0}` exists but is not a directory.",
                          ravello_dir)
    elif st is None:
        os.mkdir(ravello_dir)
    distfile = os.path.join(ravello_dir, 'dist.tar.gz')
    try:
        st = os.stat(distfile)
    except __HOLE__:
        st = None
    if st and st.st_mtime >= env.start_time:
        return distfile
    archive = tarfile.TarFile.open(distfile, 'w:gz')
    repotype = env.manifest['repository']['type']
    files = versioncontrol.walk_repository('.', repotype)
    for fname in files:
        if fname.startswith(ravello_dir):
            continue
        archive.add(fname, recursive=False)
    archive.close()
    return distfile
dataset/ETHPy150Open ravello/testmill/lib/testmill/tasks.py/create_archive