def fetch(): cmd = ['git', 'fetch', get_remote(), 'refs/heads/{0}:refs/remotes/origin/{0}'.format(get_branch())] p = Popen(cmd, cwd=get_repository().workdir) status = p.wait() if status: raise GitError('git-fetch returned with exit status {}'.format(status))
def fetch(): cmd = [ 'git', 'fetch', get_remote(), 'refs/heads/{0}:refs/remotes/origin/{0}'.format(get_branch()), ] p = Popen(cmd, cwd=get_repository().workdir) status = p.wait() if status: raise GitError('git-fetch returned with exit status {}'.format(status))
def begin(): global _transaction if _transaction: raise GitError('there is already a transaction running') repo = get_repository() if repo is None: raise GitError('no repository found') ref = 'refs/heads/{}'.format(get_branch()) try: parents = [repo.lookup_reference(ref).oid] except KeyError: parents = [] _transaction = Transaction(repo, parents)
def begin(): global _transaction if _transaction: raise GitError('there is already a transaction running') _transaction = Transaction(repository_path=get_repository(), branch_name=get_branch())
def clean(self, value): try: git_orm.set_repository(value) except git_orm.GitError as e: raise ValueError(e) return git_orm.get_repository()
def format(self, repo): repo = git_orm.get_repository() path = repo.path if repo else None return super().format(path)