[CMF-checkins] CVS: CMF/CMFStaging - VersionsTool.py:1.14

Shane Hathaway shane at zope.com
Thu Jan 29 18:13:30 EST 2004


Update of /cvs-repository/CMF/CMFStaging
In directory cvs.zope.org:/tmp/cvs-serv14503

Modified Files:
	VersionsTool.py 
Log Message:
getVersionId() can now generate the plus sign indicating checked-out status.


=== CMF/CMFStaging/VersionsTool.py 1.13 => 1.14 ===
--- CMF/CMFStaging/VersionsTool.py:1.13	Mon Jan 19 15:54:53 2004
+++ CMF/CMFStaging/VersionsTool.py	Thu Jan 29 18:13:29 2004
@@ -221,14 +221,22 @@
 
 
     security.declarePublic('getVersionId')
-    def getVersionId(self, obj):
+    def getVersionId(self, obj, plus=0):
         """Returns the version ID of the current revision.
+
+        If the 'plus' flag is set and the object is checked out, the
+        version ID will include a plus sign to indicate that when the
+        object is checked in, it will have a higher version number.
         """
         verifyPermission(UseVersionControl, obj)
         obj = unproxied(obj)
         repo = self._getVersionRepository()
         if repo.isUnderVersionControl(obj):
-            return repo.getVersionInfo(obj).version_id
+            info = repo.getVersionInfo(obj)
+            res = info.version_id
+            if plus and info.status == info.CHECKED_OUT:
+                res += '+'
+            return res
         else:
             return ''
 




More information about the CMF-checkins mailing list