changeset 2857:bad89b2fe618 beta

Pass on RhodeCode config file down to a python-based Hg hook via the extras pseudo-config key, see https://bitbucket.org/marcinkuzminski/rhodecode/issue/558/access-to-rhodecode-config-from-a-hg
author Vincent Caron <vcaron@bearstech.com>
date Fri, 07 Sep 2012 22:59:08 +0200
parents 94575ebeeabd
children dd2d5b65cae9
files rhodecode/lib/middleware/simplehg.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/lib/middleware/simplehg.py	Wed Sep 19 23:05:42 2012 +0200
+++ b/rhodecode/lib/middleware/simplehg.py	Fri Sep 07 22:59:08 2012 +0200
@@ -152,12 +152,14 @@
 
         # extras are injected into mercurial UI object and later available
         # in hg hooks executed by rhodecode
+        from rhodecode import CONFIG
         extras = {
             'ip': ipaddr,
             'username': username,
             'action': action,
             'repository': repo_name,
             'scm': 'hg',
+            'config': CONFIG['__file__'],
             'make_lock': None,
             'locked_by': [None, None]
         }