Mercurial > kallithea
changeset 3590:47631be9f449 beta
fix GIT env extraction
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Mon, 25 Mar 2013 22:51:06 +0100 |
parents | 35454cd8233b |
children | 2b3a553eaaad |
files | rhodecode/lib/hooks.py rhodecode/lib/utils2.py |
diffstat | 2 files changed, 6 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/lib/hooks.py Mon Mar 25 22:17:17 2013 +0100 +++ b/rhodecode/lib/hooks.py Mon Mar 25 22:51:06 2013 +0100 @@ -318,7 +318,7 @@ from rhodecode.model import init_model from rhodecode.model.db import RhodeCodeUi from rhodecode.lib.utils import make_ui - extras = json.loads(env['RHODECODE_EXTRAS']) + extras = _extract_extras(env) path, ini_name = os.path.split(extras['config']) conf = appconfig('config:%s' % ini_name, relative_to=path) @@ -339,8 +339,6 @@ _hooks = dict(baseui.configitems('hooks')) or {} - for k, v in extras.items(): - baseui.setconfig('rhodecode_extras', k, v) if hook_type == 'pre': repo = repo.scm_instance else:
--- a/rhodecode/lib/utils2.py Mon Mar 25 22:17:17 2013 +0100 +++ b/rhodecode/lib/utils2.py Mon Mar 25 22:51:06 2013 +0100 @@ -583,13 +583,16 @@ return req.host_url + req.script_name -def _extract_extras(): +def _extract_extras(env=None): """ Extracts the rc extras data from os.environ, and wraps it into named AttributeDict object """ + if not env: + env = os.environ + try: - rc_extras = json.loads(os.environ['RC_SCM_DATA']) + rc_extras = json.loads(env['RC_SCM_DATA']) except: print os.environ print >> sys.stderr, traceback.format_exc()