[CMF-checkins] CVS: CMF/CMFStaging - StagingTool.py:1.4 VersionsTool.py:1.3

Shane Hathaway shane@cvs.zope.org
Mon, 13 May 2002 15:21:09 -0400


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

Modified Files:
	StagingTool.py VersionsTool.py 
Log Message:

- Added tests of the versions tool.

- Added a test of a complete combination of the three tools.

- Made the name of the version repository configurable.



=== CMF/CMFStaging/StagingTool.py 1.3 => 1.4 ===
     auto_checkin = 1
 
+    repository_name = 'VersionRepository'
+
     # _stages maps stage names to relative paths.
     # This should be configurable TTW.
     _stages = {
@@ -61,7 +63,7 @@
     #manage_overview = DTMLFile( 'explainStagingTool', _dtmldir )
 
     def _getVersionRepository(self):
-        repo = aq_acquire(self, 'VersionRepository', containment=1)
+        repo = aq_acquire(self, self.repository_name, containment=1)
         return repo
 
 


=== CMF/CMFStaging/VersionsTool.py 1.2 => 1.3 ===
     auto_copy_forward = 1
 
+    repository_name = 'VersionRepository'
+
     security.declareProtected(ManagePortal, 'manage_overview' )
     #manage_overview = DTMLFile( 'explainVersionsTool', _dtmldir )
 
     def _getVersionRepository(self):
-        repo = aq_acquire(self, 'VersionRepository', containment=1)
+        repo = aq_acquire(self, self.repository_name, containment=1)
         return repo
 
 
@@ -182,7 +184,7 @@
         if self.isCheckedOut(object):
             # Save the current data.
             self.checkin(object, 'Auto-saved')
-        repo.updateResource(object, version_id)
+        return repo.updateResource(object, version_id)
 
 InitializeClass(VersionsTool)