diff rhodecode/lib/middleware/simplehg.py @ 3577:238486bb71ab beta

Switched handling of RhodeCode extra params in consistent way - use only os.environ for both hg and git - hacking ui objects was bad - os.environ allows easier to call rhodecode hooks externally
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 24 Mar 2013 03:07:04 +0100
parents 7174ee850baa
children 260a7a01b054
line wrap: on
line diff
--- a/rhodecode/lib/middleware/simplehg.py	Thu Mar 21 11:26:58 2013 +0100
+++ b/rhodecode/lib/middleware/simplehg.py	Sun Mar 24 03:07:04 2013 +0100
@@ -35,7 +35,8 @@
 from webob.exc import HTTPNotFound, HTTPForbidden, HTTPInternalServerError, \
     HTTPBadRequest, HTTPNotAcceptable
 
-from rhodecode.lib.utils2 import safe_str, fix_PATH, get_server_url
+from rhodecode.lib.utils2 import safe_str, fix_PATH, get_server_url,\
+    _set_extras
 from rhodecode.lib.base import BaseVCSController
 from rhodecode.lib.auth import get_container_username
 from rhodecode.lib.utils import make_ui, is_valid_repo, ui_sections
@@ -276,11 +277,6 @@
         # make our hgweb quiet so it doesn't print output
         baseui.setconfig('ui', 'quiet', 'true')
 
-        #inject some additional parameters that will be available in ui
-        #for hooks
-        for k, v in extras.items():
-            baseui.setconfig('rhodecode_extras', k, v)
-
         repoui = make_ui('file', hgrc, False)
 
         if repoui:
@@ -288,3 +284,4 @@
             for section in ui_sections:
                 for k, v in repoui.configitems(section):
                     baseui.setconfig(section, k, v)
+        _set_extras(extras)