Commit 3dc6901a authored by Hanno Schlichting's avatar Hanno Schlichting

Added automatic inline migration for databases created with older Zope...

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.
parent 5d10c747
......@@ -23,6 +23,10 @@ Known issues
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.
......
......@@ -139,18 +139,6 @@ class DatabaseChooser(SimpleItem):
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
......
......@@ -140,6 +140,7 @@ class HelpTopic(Implicit, HelpTopicBase, Item, PropertyManager, Persistent):
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
......
......@@ -289,6 +289,17 @@ class AppInitializer:
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'):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment