[Treepkg-commits] r510 - trunk/treepkg

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Feb 2 11:26:03 CET 2011


Author: bricks
Date: 2011-02-02 11:26:02 +0100 (Wed, 02 Feb 2011)
New Revision: 510

Modified:
   trunk/treepkg/git.py
Log:
checkout git branch on update
this may be necessary if a treepkg config has changed and a branch is used instead of master


Modified: trunk/treepkg/git.py
===================================================================
--- trunk/treepkg/git.py	2011-02-02 10:00:48 UTC (rev 509)
+++ trunk/treepkg/git.py	2011-02-02 10:26:02 UTC (rev 510)
@@ -28,9 +28,12 @@
         run.call(cmdexpand("git checkout -q --track -b local $branch",
                             **locals()), cwd=localdir)
 
-def update(localdir, revision=None):
+def update(localdir, branch=None):
     """Runs git pull on the localdir."""
     run.call(cmdexpand("git pull -q"), cwd=localdir)
+    if branch:
+        run.call(cmdexpand("git checkout -q $branch", branch=branch),
+                cwd=localdir)
 
 def export(src, dest):
     """Exports the local branch from src to dest"""



More information about the Treepkg-commits mailing list