# HG changeset patch # User Sylvain Thénault # Date 1251730140 -7200 # Node ID f77dd366544f3d395bb5b49ab29f1f10ea9abb66 # Parent a8e901fc44579d1da9490a4c0456a0ba46291a52# Parent e3e5ab4b987abd202d6b5d774faf865633b9fa17 merge diff -r e3e5ab4b987a -r f77dd366544f cwconfig.py --- a/cwconfig.py Mon Aug 31 14:37:48 2009 +0200 +++ b/cwconfig.py Mon Aug 31 16:49:00 2009 +0200 @@ -134,6 +134,9 @@ 'float' : 'Float', } +_forced_mode = os.environ.get('CW_MODE') +assert _forced_mode in (None, 'system', 'user') + class CubicWebNoAppConfiguration(ConfigurationMixIn): """base class for cubicweb configuration without a specific instance directory """ @@ -150,7 +153,7 @@ CUBES_DIR = '%(APYCOT_ROOT)s/local/share/cubicweb/cubes/' % os.environ # create __init__ file file(join(CUBES_DIR, '__init__.py'), 'w').close() - elif exists(join(CW_SOFTWARE_ROOT, '.hg')) or os.environ.get('CW_MODE') == 'user': + elif (exists(join(CW_SOFTWARE_ROOT, '.hg')) and _forced_mode != 'system') or _forced_mode == 'user': mode = 'dev' CUBES_DIR = abspath(normpath(join(CW_SOFTWARE_ROOT, '../cubes'))) else: diff -r e3e5ab4b987a -r f77dd366544f web/views/editforms.py --- a/web/views/editforms.py Mon Aug 31 14:37:48 2009 +0200 +++ b/web/views/editforms.py Mon Aug 31 16:49:00 2009 +0200 @@ -371,6 +371,8 @@ entity """ id = 'copy' + warning_message = _('Please note that this is only a shallow copy') + def render_form(self, entity): """fetch and render the form""" # make a copy of entity to avoid altering the entity in the @@ -381,7 +383,7 @@ self.initialize_varmaker() self.newentity.eid = self.varmaker.next() self.w(u'\n' - % self.req._('Please note that this is only a shallow copy')) + % self.req._(self.warning_message)) super(CopyFormView, self).render_form(self.newentity) del self.newentity