def mirror(name, url): target_path = os.path.join(config.REPOS_PATH, name) target_path = endwith_git(target_path) repository_exist = is_repository(target_path) if repository_exist: raise JagareError("repository already exists", 409) Jagare.mirror(url, target_path) return make_message_response("Mirror success.")
def mirror(self, url, to_path, is_bare, branch, env): try: to_repo = Jagare.mirror(url=url, path=to_path, bare=is_bare, branch=branch, env=env) return Repository(path=to_repo.path, is_empty=to_repo.empty, is_bare=to_repo.bare, workdir=to_repo.repository.workdir, head=to_repo.head and to_repo.head.name) except Exception as e: raise ServiceUnavailable(repr(e))
def mirror(cls, url, path, env=None): Jagare.mirror(url, path, env=env)