def remove(name): g = Gitolite(os.path.join(os.getcwd(), conf.gitolite_path)) g.remove_repo(name) g.save() subprocess.check_call( ["sudo", "rm", "-rf", "data/repos/git/repositories/" + name + ".git"], cwd=os.getcwd())
def remove_test_repo(repo_name): if not repo_name in _test_repos: return if not os.path.isdir(wds): os.mkdir(wds) manager = Gitolite(path=os.path.join(wds, 'gitolite-admin'), url=test_settings['gitolite_url']) manager.remove_repo(repo_name) manager.save() rm('-rf', wds) _test_repos.remove(repo_name)
def remove_test_repos(): if len(_test_repos) == 0: return if not os.path.isdir(wds): os.mkdir(wds) manager = Gitolite(path=os.path.join(wds, 'gitolite-admin'), url=test_settings['gitolite_url']) for repo in set(_test_repos): manager.remove_repo(repo) manager.save() rm('-rf', wds) _test_repos.clear()