changeset 2870:cbf0775ff6b4 beta

There's no need to use special env variable for config file, it's already passed in in extras now
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 26 Sep 2012 21:04:27 +0200
parents ccbdff90e5a0
children b54d1024d9ea
files rhodecode/lib/hooks.py rhodecode/lib/middleware/pygrack.py
diffstat 2 files changed, 3 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/lib/hooks.py	Wed Sep 26 20:59:37 2012 +0200
+++ b/rhodecode/lib/hooks.py	Wed Sep 26 21:04:27 2012 +0200
@@ -317,8 +317,9 @@
     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'])
 
-    path, ini_name = os.path.split(env['RHODECODE_CONFIG_FILE'])
+    path, ini_name = os.path.split(extras['config'])
     conf = appconfig('config:%s' % ini_name, relative_to=path)
     load_environment(conf.global_conf, conf.local_conf)
 
@@ -337,7 +338,6 @@
 
     _hooks = dict(baseui.configitems('hooks')) or {}
 
-    extras = json.loads(env['RHODECODE_EXTRAS'])
     for k, v in extras.items():
         baseui.setconfig('rhodecode_extras', k, v)
     repo = repo.scm_instance
--- a/rhodecode/lib/middleware/pygrack.py	Wed Sep 26 20:59:37 2012 +0200
+++ b/rhodecode/lib/middleware/pygrack.py	Wed Sep 26 21:04:27 2012 +0200
@@ -118,18 +118,15 @@
 
         try:
             gitenv = os.environ
-            from rhodecode import CONFIG
             from rhodecode.lib.compat import json
             gitenv['RHODECODE_EXTRAS'] = json.dumps(self.extras)
             # forget all configs
             gitenv['GIT_CONFIG_NOGLOBAL'] = '1'
-            # we need current .ini file used to later initialize rhodecode
-            # env and connect to db
-            gitenv['RHODECODE_CONFIG_FILE'] = CONFIG['__file__']
             opts = dict(
                 env=gitenv,
                 cwd=os.getcwd()
             )
+
             out = subprocessio.SubprocessIOChunker(
                 r'git %s --stateless-rpc "%s"' % (git_command[4:],
                                                   self.content_path),