Skip to content

Instantly share code, notes, and snippets.

@sjl
Created January 17, 2012 19:30
Show Gist options
  • Save sjl/1628352 to your computer and use it in GitHub Desktop.
Save sjl/1628352 to your computer and use it in GitHub Desktop.
diff --git a/deploy/fabfile.py b/deploy/fabfile.py
index 8efb13b..7f77d67 100644
--- a/deploy/fabfile.py
+++ b/deploy/fabfile.py
@@ -259,6 +259,14 @@ def _git_checkout(commit):
run('chmod g+w -R .git 2> /dev/null; /bin/true')
_clear_permissions('.')
+def _git_checkout_branch_and_reset(commit, branch):
+ run('git fetch')
+ run('git checkout %s' % branch)
+ run('git reset --hard %s' % commit)
+ run('chgrp pcf-web -R .git 2> /dev/null; /bin/true')
+ run('chmod g+w -R .git 2> /dev/null; /bin/true')
+ _clear_permissions('.')
+
def _get_optional_repo_version(dir, repo):
'''Find the optional repo version by looking at its file in optional/.'''
@@ -297,7 +305,7 @@ def _update_integration(dir):
with cd(os.path.join(dir, 'unisubs', 'unisubs-integration')):
with settings(warn_only=True):
- _git_checkout(_get_optional_repo_version(dir, 'unisubs-integration'))
+ _git_checkout_branch_and_reset(_get_optional_repo_version(dir, 'unisubs-integration'), 'master')
def update_integration():
'''Update the integration repo to the version recorded in the site repo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment