diff --git a/rhodecode/lib/hooks.py b/rhodecode/lib/hooks.py --- a/rhodecode/lib/hooks.py +++ b/rhodecode/lib/hooks.py @@ -318,7 +318,7 @@ def handle_git_receive(repo_path, revs, 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 @@ def handle_git_receive(repo_path, revs, _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: diff --git a/rhodecode/lib/utils2.py b/rhodecode/lib/utils2.py --- a/rhodecode/lib/utils2.py +++ b/rhodecode/lib/utils2.py @@ -583,13 +583,16 @@ def get_server_url(environ): 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()