changeset 324:77d0f8a4e838

Cleaner last_changed_revision function
author Andre Heinecke <aheinecke@intevation.de>
date Fri, 12 Mar 2010 14:27:03 +0000
parents ef983263b875
children 85b5667f543e
files treepkg/git.py
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/treepkg/git.py	Fri Mar 12 11:04:31 2010 +0000
+++ b/treepkg/git.py	Fri Mar 12 14:27:03 2010 +0000
@@ -41,11 +41,9 @@
              cwd=src)
 
 def last_changed_revision(git_working_copy):
-    """Return the last changed revision of a Git branch 
-       as an incrementing Number"""
+    """Return the number of commits in the current branch"""
     output = run.capture_output(cmdexpand("/bin/bash -c \
-                                \"git rev-list local | nl | tail -n 1 | \
-                                  awk \'{print $$1}\'\""
+                                \"git rev-list local | wc -l \""
                                 , **locals()), cwd=git_working_copy)
     if output is None:
         raise GitError("Cannot determine last changed revision for %r"
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)