Show More
@@ -103,6 +103,7 b' class VcsServer(object):' | |||
|
103 | 103 | 'repository': self.repo_name, |
|
104 | 104 | 'scm': self.backend, |
|
105 | 105 | 'config': self.ini_path, |
|
106 | 'repo_store': self.store, | |
|
106 | 107 | 'make_lock': None, |
|
107 | 108 | 'locked_by': [None, None], |
|
108 | 109 | 'server_url': None, |
@@ -121,6 +121,8 b' class TestGitServer(object):' | |||
|
121 | 121 | ]) |
|
122 | 122 | def test_update_environment(self, git_server, repo_mode, action): |
|
123 | 123 | server = git_server.create(repo_mode=repo_mode) |
|
124 | store = server.store | |
|
125 | ||
|
124 | 126 | with mock.patch('os.environ', {'SSH_CLIENT': '10.10.10.10 b'}): |
|
125 | 127 | with mock.patch('os.putenv') as putenv_mock: |
|
126 | 128 | server.update_environment(action) |
@@ -135,6 +137,7 b' class TestGitServer(object):' | |||
|
135 | 137 | 'ip': '10.10.10.10', |
|
136 | 138 | 'locked_by': [None, None], |
|
137 | 139 | 'config': '', |
|
140 | 'repo_store': store, | |
|
138 | 141 | 'server_url': None, |
|
139 | 142 | 'hooks': ['push', 'pull'], |
|
140 | 143 | 'is_shadow_repo': False, |
@@ -180,7 +180,12 b' def vcs_operation_context(' | |||
|
180 | 180 | ui_settings = settings_model.get_ui_settings() |
|
181 | 181 | |
|
182 | 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 | 189 | scm_data = { |
|
185 | 190 | 'ip': get_ip_addr(environ), |
|
186 | 191 | 'username': username, |
@@ -189,6 +194,7 b' def vcs_operation_context(' | |||
|
189 | 194 | 'repository': repo_name, |
|
190 | 195 | 'scm': scm, |
|
191 | 196 | 'config': rhodecode.CONFIG['__file__'], |
|
197 | 'repo_store': repo_store, | |
|
192 | 198 | 'make_lock': make_lock, |
|
193 | 199 | 'locked_by': locked_by, |
|
194 | 200 | 'server_url': utils2.get_server_url(environ), |
@@ -42,6 +42,7 b' def scm_extras(user_regular, repo_stub):' | |||
|
42 | 42 | 'repository': repo_stub.repo_name, |
|
43 | 43 | 'scm': repo_stub.scm_instance().alias, |
|
44 | 44 | 'config': '', |
|
45 | 'repo_store': '', | |
|
45 | 46 | 'server_url': 'http://example.com', |
|
46 | 47 | 'make_lock': None, |
|
47 | 48 | 'user-agent': 'some-client', |
@@ -43,6 +43,7 b' def repo_push_event(backend, user_regula' | |||
|
43 | 43 | 'repository': repo.repo_name, |
|
44 | 44 | 'scm': repo.scm_instance().alias, |
|
45 | 45 | 'config': '', |
|
46 | 'repo_store': '', | |
|
46 | 47 | 'server_url': 'http://example.com', |
|
47 | 48 | 'make_lock': None, |
|
48 | 49 | 'locked_by': [None], |
@@ -70,6 +70,7 b' def hook_extras(user_regular, repo_stub)' | |||
|
70 | 70 | 'repository': repo_stub.repo_name, |
|
71 | 71 | 'scm': '', |
|
72 | 72 | 'config': '', |
|
73 | 'repo_store': '', | |
|
73 | 74 | 'server_url': 'http://example.com', |
|
74 | 75 | 'make_lock': None, |
|
75 | 76 | 'user_agent': 'some-client', |
@@ -471,6 +471,7 b' def merge_extras(user_regular):' | |||
|
471 | 471 | 'repository': 'fake_target_repo_name', |
|
472 | 472 | 'scm': 'git', |
|
473 | 473 | 'config': 'fake_config_ini_path', |
|
474 | 'repo_store': '', | |
|
474 | 475 | 'make_lock': None, |
|
475 | 476 | 'locked_by': [None, None, None], |
|
476 | 477 | 'server_url': 'http://test.example.com:5000', |
General Comments 0
You need to be logged in to leave comments.
Login now