##// END OF EJS Templates
hooks: pass in store_path into env for hooks.
marcink -
r3094:3f2abfbb default
parent child Browse files
Show More
@@ -103,6 +103,7 b' class VcsServer(object):'
103 'repository': self.repo_name,
103 'repository': self.repo_name,
104 'scm': self.backend,
104 'scm': self.backend,
105 'config': self.ini_path,
105 'config': self.ini_path,
106 'repo_store': self.store,
106 'make_lock': None,
107 'make_lock': None,
107 'locked_by': [None, None],
108 'locked_by': [None, None],
108 'server_url': None,
109 'server_url': None,
@@ -121,6 +121,8 b' class TestGitServer(object):'
121 ])
121 ])
122 def test_update_environment(self, git_server, repo_mode, action):
122 def test_update_environment(self, git_server, repo_mode, action):
123 server = git_server.create(repo_mode=repo_mode)
123 server = git_server.create(repo_mode=repo_mode)
124 store = server.store
125
124 with mock.patch('os.environ', {'SSH_CLIENT': '10.10.10.10 b'}):
126 with mock.patch('os.environ', {'SSH_CLIENT': '10.10.10.10 b'}):
125 with mock.patch('os.putenv') as putenv_mock:
127 with mock.patch('os.putenv') as putenv_mock:
126 server.update_environment(action)
128 server.update_environment(action)
@@ -135,6 +137,7 b' class TestGitServer(object):'
135 'ip': '10.10.10.10',
137 'ip': '10.10.10.10',
136 'locked_by': [None, None],
138 'locked_by': [None, None],
137 'config': '',
139 'config': '',
140 'repo_store': store,
138 'server_url': None,
141 'server_url': None,
139 'hooks': ['push', 'pull'],
142 'hooks': ['push', 'pull'],
140 'is_shadow_repo': False,
143 'is_shadow_repo': False,
@@ -180,7 +180,12 b' def vcs_operation_context('
180 ui_settings = settings_model.get_ui_settings()
180 ui_settings = settings_model.get_ui_settings()
181
181
182 # NOTE(marcink): This should be also in sync with
182 # NOTE(marcink): This should be also in sync with
183 # rhodecode/apps/ssh_support/lib/backends/base.py:update_enviroment scm_data
183 # rhodecode/apps/ssh_support/lib/backends/base.py:update_environment scm_data
184 store = [x for x in ui_settings if x.key == '/']
185 repo_store = ''
186 if store:
187 repo_store = store[0].value
188
184 scm_data = {
189 scm_data = {
185 'ip': get_ip_addr(environ),
190 'ip': get_ip_addr(environ),
186 'username': username,
191 'username': username,
@@ -189,6 +194,7 b' def vcs_operation_context('
189 'repository': repo_name,
194 'repository': repo_name,
190 'scm': scm,
195 'scm': scm,
191 'config': rhodecode.CONFIG['__file__'],
196 'config': rhodecode.CONFIG['__file__'],
197 'repo_store': repo_store,
192 'make_lock': make_lock,
198 'make_lock': make_lock,
193 'locked_by': locked_by,
199 'locked_by': locked_by,
194 'server_url': utils2.get_server_url(environ),
200 'server_url': utils2.get_server_url(environ),
@@ -42,6 +42,7 b' def scm_extras(user_regular, repo_stub):'
42 'repository': repo_stub.repo_name,
42 'repository': repo_stub.repo_name,
43 'scm': repo_stub.scm_instance().alias,
43 'scm': repo_stub.scm_instance().alias,
44 'config': '',
44 'config': '',
45 'repo_store': '',
45 'server_url': 'http://example.com',
46 'server_url': 'http://example.com',
46 'make_lock': None,
47 'make_lock': None,
47 'user-agent': 'some-client',
48 'user-agent': 'some-client',
@@ -43,6 +43,7 b' def repo_push_event(backend, user_regula'
43 'repository': repo.repo_name,
43 'repository': repo.repo_name,
44 'scm': repo.scm_instance().alias,
44 'scm': repo.scm_instance().alias,
45 'config': '',
45 'config': '',
46 'repo_store': '',
46 'server_url': 'http://example.com',
47 'server_url': 'http://example.com',
47 'make_lock': None,
48 'make_lock': None,
48 'locked_by': [None],
49 'locked_by': [None],
@@ -70,6 +70,7 b' def hook_extras(user_regular, repo_stub)'
70 'repository': repo_stub.repo_name,
70 'repository': repo_stub.repo_name,
71 'scm': '',
71 'scm': '',
72 'config': '',
72 'config': '',
73 'repo_store': '',
73 'server_url': 'http://example.com',
74 'server_url': 'http://example.com',
74 'make_lock': None,
75 'make_lock': None,
75 'user_agent': 'some-client',
76 'user_agent': 'some-client',
@@ -471,6 +471,7 b' def merge_extras(user_regular):'
471 'repository': 'fake_target_repo_name',
471 'repository': 'fake_target_repo_name',
472 'scm': 'git',
472 'scm': 'git',
473 'config': 'fake_config_ini_path',
473 'config': 'fake_config_ini_path',
474 'repo_store': '',
474 'make_lock': None,
475 'make_lock': None,
475 'locked_by': [None, None, None],
476 'locked_by': [None, None, None],
476 'server_url': 'http://test.example.com:5000',
477 'server_url': 'http://test.example.com:5000',
General Comments 0
You need to be logged in to leave comments. Login now