##// END OF EJS Templates
fix GIT env extraction
marcink -
r3590:47631be9 beta
parent child Browse files
Show More
@@ -318,7 +318,7 b' def handle_git_receive(repo_path, revs, '
318 from rhodecode.model import init_model
318 from rhodecode.model import init_model
319 from rhodecode.model.db import RhodeCodeUi
319 from rhodecode.model.db import RhodeCodeUi
320 from rhodecode.lib.utils import make_ui
320 from rhodecode.lib.utils import make_ui
321 extras = json.loads(env['RHODECODE_EXTRAS'])
321 extras = _extract_extras(env)
322
322
323 path, ini_name = os.path.split(extras['config'])
323 path, ini_name = os.path.split(extras['config'])
324 conf = appconfig('config:%s' % ini_name, relative_to=path)
324 conf = appconfig('config:%s' % ini_name, relative_to=path)
@@ -339,8 +339,6 b' def handle_git_receive(repo_path, revs, '
339
339
340 _hooks = dict(baseui.configitems('hooks')) or {}
340 _hooks = dict(baseui.configitems('hooks')) or {}
341
341
342 for k, v in extras.items():
343 baseui.setconfig('rhodecode_extras', k, v)
344 if hook_type == 'pre':
342 if hook_type == 'pre':
345 repo = repo.scm_instance
343 repo = repo.scm_instance
346 else:
344 else:
@@ -583,13 +583,16 b' def get_server_url(environ):'
583 return req.host_url + req.script_name
583 return req.host_url + req.script_name
584
584
585
585
586 def _extract_extras():
586 def _extract_extras(env=None):
587 """
587 """
588 Extracts the rc extras data from os.environ, and wraps it into named
588 Extracts the rc extras data from os.environ, and wraps it into named
589 AttributeDict object
589 AttributeDict object
590 """
590 """
591 if not env:
592 env = os.environ
593
591 try:
594 try:
592 rc_extras = json.loads(os.environ['RC_SCM_DATA'])
595 rc_extras = json.loads(env['RC_SCM_DATA'])
593 except:
596 except:
594 print os.environ
597 print os.environ
595 print >> sys.stderr, traceback.format_exc()
598 print >> sys.stderr, traceback.format_exc()
General Comments 0
You need to be logged in to leave comments. Login now