[Treepkg-commits] r533 - trunk/treepkg

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Sep 2 13:46:30 CEST 2011


Author: bricks
Date: 2011-09-02 13:46:29 +0200 (Fri, 02 Sep 2011)
New Revision: 533

Modified:
   trunk/treepkg/git.py
Log:
Refactor git pull command out of update
Tag MUST NOT use update because therefore it always changes the current local branch!
For listing the tags it's enough to pull the latest repo changes


Modified: trunk/treepkg/git.py
===================================================================
--- trunk/treepkg/git.py	2011-09-02 11:20:20 UTC (rev 532)
+++ trunk/treepkg/git.py	2011-09-02 11:46:29 UTC (rev 533)
@@ -72,9 +72,13 @@
         """Copies the working copy to destdir (including .git dir)"""
         shutils.copytree(localdir, destdir)
 
+    def pull(self, localdir):
+        self.log_info("Pulling the repo in '%s'" % localdir)
+        run.call(cmdexpand("git pull -q"), cwd=localdir)
+
     def update(self, localdir):
         """Runs git pull on the localdir."""
-        run.call(cmdexpand("git pull -q"), cwd=localdir)
+        self.pull()
         output = capture_output(cmdexpand("git branch"), cwd=localdir)
         branches = output.splitlines()
         cur_branch = None
@@ -203,7 +207,7 @@
         self.workingcopy = GitWorkingCopy(repo, localdir)
 
     def list_tags(self):
-        self.workingcopy.update_or_checkout()
+        self.workingcopy.pull()
         tags = self.workingcopy.list_tags(self.pattern)
         return sorted(tags)
 



More information about the Treepkg-commits mailing list