comparison treepkg/git.py @ 547:70fa7debabed

checkout git branch on update this may be necessary if a treepkg config has changed and a branch is used instead of master
author Bjoern Ricks <bricks@intevation.de>
date Wed, 02 Feb 2011 10:26:02 +0000
parents 149d18aca4f7
children f841b369aa80
comparison
equal deleted inserted replaced
546:149d18aca4f7 547:70fa7debabed
26 run.call(cmdexpand("git clone -q $url $localdir", **locals())) 26 run.call(cmdexpand("git clone -q $url $localdir", **locals()))
27 if branch: 27 if branch:
28 run.call(cmdexpand("git checkout -q --track -b local $branch", 28 run.call(cmdexpand("git checkout -q --track -b local $branch",
29 **locals()), cwd=localdir) 29 **locals()), cwd=localdir)
30 30
31 def update(localdir, revision=None): 31 def update(localdir, branch=None):
32 """Runs git pull on the localdir.""" 32 """Runs git pull on the localdir."""
33 run.call(cmdexpand("git pull -q"), cwd=localdir) 33 run.call(cmdexpand("git pull -q"), cwd=localdir)
34 if branch:
35 run.call(cmdexpand("git checkout -q $branch", branch=branch),
36 cwd=localdir)
34 37
35 def export(src, dest): 38 def export(src, dest):
36 """Exports the local branch from src to dest""" 39 """Exports the local branch from src to dest"""
37 dest = dest + os.sep 40 dest = dest + os.sep
38 run.call(cmdexpand("git checkout-index -a -f --prefix=$dest", **locals()), 41 run.call(cmdexpand("git checkout-index -a -f --prefix=$dest", **locals()),
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)