Example #1
0
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))
Example #2
0
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))
Example #3
0
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)
Example #4
0
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)
Example #5
0
def begin():
    global _transaction
    if _transaction:
        raise GitError('there is already a transaction running')
    _transaction = Transaction(repository_path=get_repository(),
                               branch_name=get_branch())
Example #6
0
 def clean(self, value):
     try:
         git_orm.set_repository(value)
     except git_orm.GitError as e:
         raise ValueError(e)
     return git_orm.get_repository()
Example #7
0
 def format(self, repo):
     repo = git_orm.get_repository()
     path = repo.path if repo else None
     return super().format(path)