def _handle_rc_scm_extras(self, username, repo_name, repo_alias, action=None): from kallithea import CONFIG from kallithea.lib.base import _get_ip_addr try: from tg import request environ = request.environ except TypeError: # we might use this outside of request context, let's fake the # environ data from webob import Request environ = Request.blank('').environ extras = { 'ip': _get_ip_addr(environ), 'username': username, 'action': action or 'push_local', 'repository': repo_name, 'scm': repo_alias, 'config': CONFIG['__file__'], 'server_url': get_server_url(environ), 'make_lock': None, 'locked_by': [None, None] } _set_extras(extras)
def __inject_extras(self, repo_path, baseui, extras=None): """ Injects some extra params into baseui instance :param baseui: baseui instance :param extras: dict with extra params to put into baseui """ _set_extras(extras or {})
def __inject_extras(self, repo_path, baseui, extras=None): """ Injects some extra params into baseui instance also overwrites global settings with those takes from local hgrc file :param baseui: baseui instance :param extras: dict with extra params to put into baseui """ hgrc = os.path.join(repo_path, '.hg', 'hgrc') repoui = make_ui('file', hgrc) if repoui: #overwrite our ui instance with the section from hgrc file for section in ui_sections: for k, v in repoui.configitems(section): baseui.setconfig(section, k, v) _set_extras(extras or {})
def __inject_extras(self, repo_path, baseui, extras={}): """ Injects some extra params into baseui instance also overwrites global settings with those takes from local hgrc file :param baseui: baseui instance :param extras: dict with extra params to put into baseui """ hgrc = os.path.join(repo_path, '.hg', 'hgrc') repoui = make_ui('file', hgrc, False) if repoui: #overwrite our ui instance with the section from hgrc file for section in ui_sections: for k, v in repoui.configitems(section): baseui.setconfig(section, k, v) _set_extras(extras)
def _handle_rc_scm_extras(self, username, repo_name, repo_alias, action=None): from kallithea import CONFIG from kallithea.lib.base import _get_ip_addr try: from pylons import request environ = request.environ except TypeError: # we might use this outside of request context, let's fake the # environ data from webob import Request environ = Request.blank('').environ extras = { 'ip': _get_ip_addr(environ), 'username': username, 'action': action or 'push_local', 'repository': repo_name, 'scm': repo_alias, 'config': CONFIG['__file__'], 'server_url': get_server_url(environ), 'make_lock': None, 'locked_by': [None, None] } _set_extras(extras)