Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
Fabfile uses custom remote and branch
Browse files Browse the repository at this point in the history
  • Loading branch information
simonrw committed Jul 29, 2016
1 parent e24c1b9 commit c84948e
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions fabfile.py
Expand Up @@ -10,12 +10,14 @@ def lrun(*args, **kwargs):


@task
def sync_repos():
def sync_repos(remote_name='origin', branch_name='master'):
with cd('~/dotfiles'):
lrun('git fetch origin')
lrun('git fetch {}'.format(remote_name))
with settings(warn_only=True):
lrun('git stash -q')
result = lrun('git merge --ff-only origin/master')
result = lrun('git merge --ff-only {}/{}'.format(
remote_name, branch_name
))
if result.failed:
open_shell()
lrun('git stash pop -q 2>/dev/null || true')
Expand All @@ -31,12 +33,12 @@ def sync_vim_plugins():

@task
@serial
def push_changes():
local('git push origin master')
def push_changes(remote_name='origin', branch_name='master'):
local('git push {} {}'.format(remote_name, branch_name))


@task(default=True)
def update():
push_changes()
sync_repos()
def update(remote_name='origin', branch_name='master'):
push_changes(remote_name=remote_name, branch_name=branch_name)
sync_repos(remote_name=remote_name, branch_name=branch_name)
sync_vim_plugins()

0 comments on commit c84948e

Please sign in to comment.