Log message for revision 99286:
  Added automatic inline migration for databases created with older Zope 
versions. The `Versions` screen from the `Control_Panel` is now automatically 
removed on Zope startup.
  

Changed:
  U   Zope/trunk/doc/CHANGES.rst
  U   Zope/trunk/src/App/ApplicationManager.py
  U   Zope/trunk/src/HelpSys/HelpTopic.py
  U   Zope/trunk/src/OFS/Application.py

-=-
Modified: Zope/trunk/doc/CHANGES.rst
===================================================================
--- Zope/trunk/doc/CHANGES.rst  2009-04-19 16:38:24 UTC (rev 99285)
+++ Zope/trunk/doc/CHANGES.rst  2009-04-19 17:38:06 UTC (rev 99286)
@@ -23,6 +23,10 @@
 Restructuring
 +++++++++++++
 
+- Added automatic inline migration for databases created with older Zope
+  versions. The `Versions` screen from the `Control_Panel` is now
+  automatically removed on Zope startup.
+
 - Removed more unused code of the versions support feature including the
   Globals.VersionNameName constant.
 

Modified: Zope/trunk/src/App/ApplicationManager.py
===================================================================
--- Zope/trunk/src/App/ApplicationManager.py    2009-04-19 16:38:24 UTC (rev 
99285)
+++ Zope/trunk/src/App/ApplicationManager.py    2009-04-19 17:38:06 UTC (rev 
99286)
@@ -139,18 +139,6 @@
 InitializeClass(DatabaseChooser)
 
 
-class VersionManager(Item, Implicit):
-    """Version management"""
-
-    id        ='Versions'
-    name=title='Version Management'
-    meta_type ='Version Management'
-
-InitializeClass(VersionManager)
-
-
-
-
 # refcount snapshot info
 _v_rcs=None
 _v_rst=None

Modified: Zope/trunk/src/HelpSys/HelpTopic.py
===================================================================
--- Zope/trunk/src/HelpSys/HelpTopic.py 2009-04-19 16:38:24 UTC (rev 99285)
+++ Zope/trunk/src/HelpSys/HelpTopic.py 2009-04-19 17:38:06 UTC (rev 99286)
@@ -140,6 +140,7 @@
         self._v_last_read = mtime
 
     def _check_for_update(self):
+        import Globals
         if Globals.DevelopmentMode:
             try:    mtime=os.stat(self.file)[8]
             except: mtime=0

Modified: Zope/trunk/src/OFS/Application.py
===================================================================
--- Zope/trunk/src/OFS/Application.py   2009-04-19 16:38:24 UTC (rev 99285)
+++ Zope/trunk/src/OFS/Application.py   2009-04-19 17:38:06 UTC (rev 99286)
@@ -289,6 +289,17 @@
             cpl._init()
             app._setObject('Control_Panel', cpl)
             self.commit('Added Control_Panel')
+        else:
+            # Inline migration of old databases
+            cp = app.Control_Panel
+            ids = [i['id'] for i in cp._objects]
+            if 'Versions' in ids:
+                new = []
+                for entry in cp._objects:
+                    if entry['id'] != 'Versions':
+                        new.append(entry)
+                cp._objects = tuple(new)
+                self.commit('Removed Control_Panel.Versions')
 
         # b/c: Ensure that a ProductFolder exists.
         if not hasattr(aq_base(app.Control_Panel), 'Products'):

_______________________________________________
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins

Reply via email to