diff --git a/rhodecode/apps/ssh_support/lib/backends/base.py b/rhodecode/apps/ssh_support/lib/backends/base.py --- a/rhodecode/apps/ssh_support/lib/backends/base.py +++ b/rhodecode/apps/ssh_support/lib/backends/base.py @@ -103,6 +103,7 @@ class VcsServer(object): 'repository': self.repo_name, 'scm': self.backend, 'config': self.ini_path, + 'repo_store': self.store, 'make_lock': None, 'locked_by': [None, None], 'server_url': None, diff --git a/rhodecode/apps/ssh_support/tests/test_server_git.py b/rhodecode/apps/ssh_support/tests/test_server_git.py --- a/rhodecode/apps/ssh_support/tests/test_server_git.py +++ b/rhodecode/apps/ssh_support/tests/test_server_git.py @@ -121,6 +121,8 @@ class TestGitServer(object): ]) def test_update_environment(self, git_server, repo_mode, action): server = git_server.create(repo_mode=repo_mode) + store = server.store + with mock.patch('os.environ', {'SSH_CLIENT': '10.10.10.10 b'}): with mock.patch('os.putenv') as putenv_mock: server.update_environment(action) @@ -135,6 +137,7 @@ class TestGitServer(object): 'ip': '10.10.10.10', 'locked_by': [None, None], 'config': '', + 'repo_store': store, 'server_url': None, 'hooks': ['push', 'pull'], 'is_shadow_repo': False, diff --git a/rhodecode/lib/base.py b/rhodecode/lib/base.py --- a/rhodecode/lib/base.py +++ b/rhodecode/lib/base.py @@ -180,7 +180,12 @@ def vcs_operation_context( ui_settings = settings_model.get_ui_settings() # NOTE(marcink): This should be also in sync with - # rhodecode/apps/ssh_support/lib/backends/base.py:update_enviroment scm_data + # rhodecode/apps/ssh_support/lib/backends/base.py:update_environment scm_data + store = [x for x in ui_settings if x.key == '/'] + repo_store = '' + if store: + repo_store = store[0].value + scm_data = { 'ip': get_ip_addr(environ), 'username': username, @@ -189,6 +194,7 @@ def vcs_operation_context( 'repository': repo_name, 'scm': scm, 'config': rhodecode.CONFIG['__file__'], + 'repo_store': repo_store, 'make_lock': make_lock, 'locked_by': locked_by, 'server_url': utils2.get_server_url(environ), diff --git a/rhodecode/tests/events/test_repo.py b/rhodecode/tests/events/test_repo.py --- a/rhodecode/tests/events/test_repo.py +++ b/rhodecode/tests/events/test_repo.py @@ -42,6 +42,7 @@ def scm_extras(user_regular, repo_stub): 'repository': repo_stub.repo_name, 'scm': repo_stub.scm_instance().alias, 'config': '', + 'repo_store': '', 'server_url': 'http://example.com', 'make_lock': None, 'user-agent': 'some-client', diff --git a/rhodecode/tests/integrations/conftest.py b/rhodecode/tests/integrations/conftest.py --- a/rhodecode/tests/integrations/conftest.py +++ b/rhodecode/tests/integrations/conftest.py @@ -43,6 +43,7 @@ def repo_push_event(backend, user_regula 'repository': repo.repo_name, 'scm': repo.scm_instance().alias, 'config': '', + 'repo_store': '', 'server_url': 'http://example.com', 'make_lock': None, 'locked_by': [None], diff --git a/rhodecode/tests/lib/test_hooks_base.py b/rhodecode/tests/lib/test_hooks_base.py --- a/rhodecode/tests/lib/test_hooks_base.py +++ b/rhodecode/tests/lib/test_hooks_base.py @@ -70,6 +70,7 @@ def hook_extras(user_regular, repo_stub) 'repository': repo_stub.repo_name, 'scm': '', 'config': '', + 'repo_store': '', 'server_url': 'http://example.com', 'make_lock': None, 'user_agent': 'some-client', diff --git a/rhodecode/tests/models/test_pullrequest.py b/rhodecode/tests/models/test_pullrequest.py --- a/rhodecode/tests/models/test_pullrequest.py +++ b/rhodecode/tests/models/test_pullrequest.py @@ -471,6 +471,7 @@ def merge_extras(user_regular): 'repository': 'fake_target_repo_name', 'scm': 'git', 'config': 'fake_config_ini_path', + 'repo_store': '', 'make_lock': None, 'locked_by': [None, None, None], 'server_url': 'http://test.example.com:5000',