merge stable cubicweb-version-3.4.4
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Tue, 18 Aug 2009 18:00:34 +0200
branchstable
changeset 2911 2aee4ea585cd
parent 2910 66684a293f01 (current diff)
parent 2907 e222fac3cca3 (diff)
child 2912 e244a0fd7d71
merge
--- a/cwctl.py	Tue Aug 18 17:59:58 2009 +0200
+++ b/cwctl.py	Tue Aug 18 18:00:34 2009 +0200
@@ -716,7 +716,13 @@
 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 @@
         else:
             sources = ('all',)
         config.set_sources_mode(sources)
+        config.repairing = self.config.force
         mih = config.migration_handler()
         if args:
             for arg in args:
--- a/cwvreg.py	Tue Aug 18 17:59:58 2009 +0200
+++ b/cwvreg.py	Tue Aug 18 18:00:34 2009 +0200
@@ -228,8 +228,8 @@
             config.init_log(debug=debug)
         super(CubicWebVRegistry, self).__init__(config)
         self.schema = None
+        self.initialized = False
         self.reset()
-        self.initialized = False
 
     def setdefault(self, regid):
         try:
@@ -256,10 +256,11 @@
         # 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()
--- a/server/__init__.py	Tue Aug 18 17:59:58 2009 +0200
+++ b/server/__init__.py	Tue Aug 18 18:00:34 2009 +0200
@@ -227,6 +227,7 @@
     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)
--- a/vregistry.py	Tue Aug 18 17:59:58 2009 +0200
+++ b/vregistry.py	Tue Aug 18 18:00:34 2009 +0200
@@ -207,7 +207,9 @@
         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):