# HG changeset patch # User RĂ©mi Cardona # Date 1448380627 -3600 # Node ID 7d01c8c675a0f7dffdbf69ba0b0e259c43e865ae # Parent 977def81780a02e351db8efd6bccaf42c84902c6 [web] Stop using webconfig.vc_config() The main issue is that this creates an entirely new Repository object (since commit 3914388b2d0f) and thus reloads all the cubes, taking for ever. Related to #8634417. diff -r 977def81780a -r 7d01c8c675a0 test/unittest_cwconfig.py --- a/test/unittest_cwconfig.py Thu Sep 24 11:26:11 2015 +0200 +++ b/test/unittest_cwconfig.py Tue Nov 24 16:57:07 2015 +0100 @@ -86,15 +86,6 @@ finally: comment_pkginfo.__recommends_cubes__ = {} - -# def test_vc_config(self): -# vcconf = self.config.vc_config() -# self.assertIsInstance(vcconf['EEMAIL'], Version) -# self.assertEqual(vcconf['EEMAIL'], (0, 3, 1)) -# self.assertEqual(vcconf['CW'], (2, 31, 2)) -# self.assertRaises(KeyError, vcconf.__getitem__, 'CW_VERSION') -# self.assertRaises(KeyError, vcconf.__getitem__, 'CRM') - def test_expand_cubes(self): self.config.__class__.CUBES_PATH = [CUSTOM_CUBES_DIR] self.config.adjust_sys_path() diff -r 977def81780a -r 7d01c8c675a0 web/views/debug.py --- a/web/views/debug.py Thu Sep 24 11:26:11 2015 +0200 +++ b/web/views/debug.py Tue Nov 24 16:57:07 2015 +0100 @@ -83,7 +83,7 @@ w(u'%s%s' % ( _('instance home'), self._cw.vreg.config.apphome)) w(u'') - vcconf = req.vreg.config.vc_config() + vcconf = req.cnx.repo.get_versions() w(u'

%s

' % _('versions configuration')) w(u'') w(u'' % ( diff -r 977def81780a -r 7d01c8c675a0 web/views/management.py --- a/web/views/management.py Thu Sep 24 11:26:11 2015 +0200 +++ b/web/views/management.py Tue Nov 24 16:57:07 2015 +0100 @@ -137,7 +137,7 @@ # if excinfo is not None, it's probably not a bug if excinfo is None: return - vcconf = self._cw.vreg.config.vc_config() + vcconf = self._cw.cnx.repo.get_versions() w(u"
") eversion = vcconf.get('cubicweb', self._cw._('no version information')) # NOTE: tuple wrapping needed since eversion is itself a tuple diff -r 977def81780a -r 7d01c8c675a0 web/webconfig.py --- a/web/webconfig.py Thu Sep 24 11:26:11 2015 +0200 +++ b/web/webconfig.py Tue Nov 24 16:57:07 2015 +0100 @@ -282,6 +282,7 @@ continue yield key, pdef + @deprecated('[3.22] call req.cnx.repo.get_versions() directly') def vc_config(self): return self.repository().get_versions()
%s%s