[jhbuild/jhdebuild: 514/536] [jhdebuild] Add revision_id property



commit f9de8c2d0ea6dd64299ff80128d7e1757b1e3193
Author: Frederic Peters <fpeters 0d be>
Date:   Sun May 17 13:44:14 2009 +0100

    [jhdebuild] Add revision_id property
---
 jhbuild/versioncontrol/cvs.py     |    8 ++++++++
 jhbuild/versioncontrol/svn.py     |    4 ++++
 jhbuild/versioncontrol/tarball.py |    5 +++++
 3 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/jhbuild/versioncontrol/cvs.py b/jhbuild/versioncontrol/cvs.py
index a68fee7..120c4b3 100644
--- a/jhbuild/versioncontrol/cvs.py
+++ b/jhbuild/versioncontrol/cvs.py
@@ -227,6 +227,14 @@ class CVSBranch(Branch):
         return self.revision
     branchname = property(branchname)
 
+    def revision_id(self):
+       from datetime import datetime
+       t = datetime.strftime(datetime.today(), '%Y%m%d%H%M')
+       if self.revision:
+           return '%s-%s' % (self.revision, t)
+       return t
+    revision_id = property(revision_id)
+
     def _export(self, buildscript):
         cmd = ['cvs', '-z3', '-q', '-d', self.repository.cvsroot,
                'export']
diff --git a/jhbuild/versioncontrol/svn.py b/jhbuild/versioncontrol/svn.py
index ba739c0..65c36a9 100644
--- a/jhbuild/versioncontrol/svn.py
+++ b/jhbuild/versioncontrol/svn.py
@@ -182,6 +182,10 @@ class SubversionBranch(Branch):
         return self.revision
     branchname = property(branchname)
 
+    def revision_id(self):
+        return get_info(self.srcdir)['last changed rev']
+    revision_id = property(revision_id)
+
     def exists(self):
         try:
             get_output(['svn', 'ls', self.module], extra_env={
diff --git a/jhbuild/versioncontrol/tarball.py b/jhbuild/versioncontrol/tarball.py
index 3888211..196df8f 100644
--- a/jhbuild/versioncontrol/tarball.py
+++ b/jhbuild/versioncontrol/tarball.py
@@ -108,6 +108,11 @@ class TarballBranch(Branch):
         self.quilt = None
         self.branch_id = branch_id
 
+    def revision_id(self):
+        return self.version
+    revision_id = property(revision_id)
+
+
     def _local_tarball(self):
         basename = os.path.basename(self.module)
         if not basename:



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