Commit 80db1f30 authored by Aurelien Campeas's avatar Aurelien Campeas
Browse files

merge

--HG--
branch : stable
......@@ -716,7 +716,13 @@ will connect to all defined sources. If 'migration' is given, appropriate \
sources for migration will be automatically selected.",
}),
('force',
{'short': 'f', 'action' : 'store_true',
'default' : False,
'help': 'don\'t check instance is up to date.'}
),
)
def run(self, args):
appid = pop_arg(args, 99, msg="No instance specified !")
config = cwcfg.config_for(appid)
......@@ -728,6 +734,7 @@ sources for migration will be automatically selected.",
else:
sources = ('all',)
config.set_sources_mode(sources)
config.repairing = self.config.force
mih = config.migration_handler()
if args:
for arg in args:
......
......@@ -228,8 +228,8 @@ class CubicWebVRegistry(VRegistry):
config.init_log(debug=debug)
super(CubicWebVRegistry, self).__init__(config)
self.schema = None
self.reset()
self.initialized = False
self.reset()
def setdefault(self, regid):
try:
......@@ -256,10 +256,11 @@ class CubicWebVRegistry(VRegistry):
# two special registries, propertydefs which care all the property
# definitions, and propertyvals which contains values for those
# properties
self['propertydefs'] = {}
self['propertyvalues'] = self.eprop_values = {}
for key, propdef in self.config.eproperty_definitions():
self.register_property(key, **propdef)
if not self.initialized:
self['propertydefs'] = {}
self['propertyvalues'] = self.eprop_values = {}
for key, propdef in self.config.eproperty_definitions():
self.register_property(key, **propdef)
if path is not None and force_reload:
cleanup_sys_modules(path)
cubes = self.config.cubes()
......
......@@ -227,6 +227,7 @@ def initialize_schema(config, schema, mhandler, event='create'):
for path in reversed(paths):
mhandler.exec_event_script('pre%s' % event, path)
# enter instance'schema into the database
mhandler.session.set_pool()
serialize_schema(mhandler.session, schema)
# execute cubicweb's post<event> script
mhandler.exec_event_script('post%s' % event)
......
......@@ -207,7 +207,9 @@ class VRegistry(dict):
self.config = config
def reset(self, path=None, force_reload=None):
self.clear()
# don't use self.clear, we want to keep existing subdictionaries
for subdict in self.itervalues():
subdict.clear()
self._lastmodifs = {}
def __getitem__(self, name):
......
Supports Markdown
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