##// END OF EJS Templates
forks: fixed forking with new landing rev....
marcink -
r3969:f86c0abc default
parent child Browse files
Show More
@@ -130,7 +130,6 b' class TestRepoForkViewTests(TestControll'
130 'repo_type': backend.alias,
130 'repo_type': backend.alias,
131 'description': description,
131 'description': description,
132 'private': 'False',
132 'private': 'False',
133 'landing_rev': 'rev:tip',
134 'csrf_token': csrf_token,
133 'csrf_token': csrf_token,
135 }
134 }
136
135
@@ -159,7 +158,6 b' class TestRepoForkViewTests(TestControll'
159 'repo_type': backend.alias,
158 'repo_type': backend.alias,
160 'description': description,
159 'description': description,
161 'private': 'False',
160 'private': 'False',
162 'landing_rev': 'rev:tip',
163 'csrf_token': csrf_token,
161 'csrf_token': csrf_token,
164 }
162 }
165 self.app.post(
163 self.app.post(
@@ -172,8 +170,8 b' class TestRepoForkViewTests(TestControll'
172 route_path('repo_creating_check', repo_name=fork_name))
170 route_path('repo_creating_check', repo_name=fork_name))
173 # test if we have a message that fork is ok
171 # test if we have a message that fork is ok
174 assert_session_flash(response,
172 assert_session_flash(response,
175 'Forked repository %s as <a href="/%s">%s</a>'
173 'Forked repository %s as <a href="/%s">%s</a>' % (
176 % (repo_name, fork_name, fork_name))
174 repo_name, fork_name, fork_name))
177
175
178 # test if the fork was created in the database
176 # test if the fork was created in the database
179 fork_repo = Session().query(Repository)\
177 fork_repo = Session().query(Repository)\
@@ -205,7 +203,6 b' class TestRepoForkViewTests(TestControll'
205 'repo_type': backend.alias,
203 'repo_type': backend.alias,
206 'description': description,
204 'description': description,
207 'private': 'False',
205 'private': 'False',
208 'landing_rev': 'rev:tip',
209 'csrf_token': csrf_token,
206 'csrf_token': csrf_token,
210 }
207 }
211 self.app.post(
208 self.app.post(
@@ -218,8 +215,8 b' class TestRepoForkViewTests(TestControll'
218 route_path('repo_creating_check', repo_name=fork_name_full))
215 route_path('repo_creating_check', repo_name=fork_name_full))
219 # test if we have a message that fork is ok
216 # test if we have a message that fork is ok
220 assert_session_flash(response,
217 assert_session_flash(response,
221 'Forked repository %s as <a href="/%s">%s</a>'
218 'Forked repository %s as <a href="/%s">%s</a>' % (
222 % (repo_name, fork_name_full, fork_name_full))
219 repo_name, fork_name_full, fork_name_full))
223
220
224 # test if the fork was created in the database
221 # test if the fork was created in the database
225 fork_repo = Session().query(Repository)\
222 fork_repo = Session().query(Repository)\
@@ -218,6 +218,7 b' class RepoForksView(RepoAppView, DataGri'
218
218
219 # forbid injecting other repo by forging a request
219 # forbid injecting other repo by forging a request
220 post_data['fork_parent_id'] = self.db_repo.repo_id
220 post_data['fork_parent_id'] = self.db_repo.repo_id
221 post_data['landing_rev'] = self.db_repo._landing_revision
221
222
222 form_result = {}
223 form_result = {}
223 task_id = None
224 task_id = None
@@ -239,7 +239,7 b' def create_repo_fork(form_data, cur_user'
239 private = form_data['private']
239 private = form_data['private']
240 clone_uri = form_data.get('clone_uri')
240 clone_uri = form_data.get('clone_uri')
241 repo_group = safe_int(form_data['repo_group'])
241 repo_group = safe_int(form_data['repo_group'])
242 landing_rev = form_data['landing_rev']
242 landing_ref = form_data['landing_rev']
243 copy_fork_permissions = form_data.get('copy_permissions')
243 copy_fork_permissions = form_data.get('copy_permissions')
244 fork_id = safe_int(form_data.get('fork_parent_id'))
244 fork_id = safe_int(form_data.get('fork_parent_id'))
245
245
@@ -253,7 +253,7 b' def create_repo_fork(form_data, cur_user'
253 private=private,
253 private=private,
254 clone_uri=clone_uri,
254 clone_uri=clone_uri,
255 repo_group=repo_group,
255 repo_group=repo_group,
256 landing_rev=landing_rev,
256 landing_rev=landing_ref,
257 fork_of=fork_of,
257 fork_of=fork_of,
258 copy_fork_permissions=copy_fork_permissions
258 copy_fork_permissions=copy_fork_permissions
259 )
259 )
General Comments 0
You need to be logged in to leave comments. Login now