changeset 570:44c0f8404983

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
author Bjoern Ricks <bricks@intevation.de>
date Fri, 02 Sep 2011 11:46:29 +0000
parents aaeca9cf0143
children 7d5abf0bba91
files treepkg/git.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/treepkg/git.py	Fri Sep 02 11:20:20 2011 +0000
+++ b/treepkg/git.py	Fri Sep 02 11:46:29 2011 +0000
@@ -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)
 
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)