# HG changeset patch # User Bjoern Ricks # Date 1314963989 0 # Node ID 44c0f84049834c8f0a34155790c491039040947b # Parent aaeca9cf0143cfb198f22db9a3402aba10ec7e8e 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 diff -r aaeca9cf0143 -r 44c0f8404983 treepkg/git.py --- 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)