Changeset - 47631be9f449
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 13 years ago 2013-03-25 22:51:06
marcin@python-works.com
fix GIT env extraction
2 files changed with 6 insertions and 5 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/hooks.py
Show inline comments
 
@@ -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:
rhodecode/lib/utils2.py
Show inline comments
 
@@ -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()
0 comments (0 inline, 0 general)