[jhbuild/jhdebuild: 528/536] [jhdebuild] Git needs code and revision_id prop



commit 53c4752b0cd8b1a022d88864a6f903f063e3778f
Author: John Carr <john carr unrouted co uk>
Date:   Sun May 17 17:30:28 2009 +0100

    [jhdebuild] Git needs code and revision_id prop
---
 jhbuild/versioncontrol/git.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/jhbuild/versioncontrol/git.py b/jhbuild/versioncontrol/git.py
index fac6680..051ef57 100644
--- a/jhbuild/versioncontrol/git.py
+++ b/jhbuild/versioncontrol/git.py
@@ -61,7 +61,7 @@ class GitRepository(Repository):
     Note that this is just the parent directory for a bunch of git
     branches, making it easy to switch to a mirror URI.
     """
-
+    code = "git"
     init_xml_attrs = ['href']
 
     def __init__(self, config, name, href):
@@ -303,6 +303,11 @@ class GitBranch(Branch):
             return None
         return output.strip()
 
+    def revision_id(self):
+        """ Use 6 characters of sha1 to identify current revision """
+        return self.tree_id()[:6]
+    revision_id = property(revision_id)
+
     def to_sxml(self):
         attrs = {}
         if self.branch:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]