diff treepkg/git.py @ 328:dd2bd0ccd674

Revisions are now handled as strings
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 17 Mar 2010 14:26:16 +0000
parents 77d0f8a4e838
children cb061f0474ba
line wrap: on
line diff
--- a/treepkg/git.py	Wed Mar 17 13:42:42 2010 +0000
+++ b/treepkg/git.py	Wed Mar 17 14:26:16 2010 +0000
@@ -41,14 +41,13 @@
              cwd=src)
 
 def last_changed_revision(git_working_copy):
-    """Return the number of commits in the current branch"""
-    output = run.capture_output(cmdexpand("/bin/bash -c \
-                                \"git rev-list local | wc -l \""
-                                , **locals()), cwd=git_working_copy)
+    """Return the SHA1 sum of the latest commit"""
+    output = run.capture_output(cmdexpand("git rev-parse HEAD"),
+                                cwd=git_working_copy)
     if output is None:
         raise GitError("Cannot determine last changed revision for %r"
-                              % git_working_copy)
-    return int(output)
+                       % git_working_copy)
+    return output.strip()
 
 class GitRepository(object):
 
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)