From 5d47ae1d8b17905936e51c74e4b27b8e265a7079 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Thu, 3 Jan 2013 17:41:18 +0100 Subject: [PATCH] Add branch/tag management in fabfile collect_remote_statics cf https://github.com/yohanboniface/django-leaflet-storage/issues/41 --- fabfile.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/fabfile.py b/fabfile.py index c0c55e75..78c1717e 100644 --- a/fabfile.py +++ b/fabfile.py @@ -252,12 +252,13 @@ def collect_remote_statics(): run('mkdir -p {0}'.format(remote_static_dir)) remote_repositories = { 'leaflet': "git://github.com/CloudMade/Leaflet.git@stable", - 'draw': "git://github.com/jacobtoye/Leaflet.draw.git", - 'hash': "git://github.com/mlevans/leaflet-hash.git", - 'storage': 'git://github.com/yohanboniface/Leaflet.Storage.git', + 'draw': "git://github.com/jacobtoye/Leaflet.draw.git@master", + 'hash': "git://github.com/mlevans/leaflet-hash.git@master", + 'storage': 'git://github.com/yohanboniface/Leaflet.Storage.git@master', } with cd(remote_static_dir): - for subdir, repository in remote_repositories.iteritems(): + for subdir, path in remote_repositories.iteritems(): + repository, branch = path.split('@') with hide("running", "stdout"): exists = run('if [ -d "{0}" ]; then echo 1; fi'.format(subdir)) if exists: @@ -265,3 +266,5 @@ def collect_remote_statics(): run('git pull') else: run('git clone {0} {1}'.format(repository, subdir)) + with cd(subdir): + run('git checkout {0}'.format(branch))