##// END OF EJS Templates
archives: allows downloading refs that have slashes and special refs. e.g f/feat1 branch names.
marcink -
r3698:3343038b new-ui
parent child Browse files
Show More
@@ -1,488 +1,488 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2
2
3 # Copyright (C) 2016-2019 RhodeCode GmbH
3 # Copyright (C) 2016-2019 RhodeCode GmbH
4 #
4 #
5 # This program is free software: you can redistribute it and/or modify
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License, version 3
6 # it under the terms of the GNU Affero General Public License, version 3
7 # (only), as published by the Free Software Foundation.
7 # (only), as published by the Free Software Foundation.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU Affero General Public License
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
16 #
17 # This program is dual-licensed. If you wish to learn more about the
17 # This program is dual-licensed. If you wish to learn more about the
18 # RhodeCode Enterprise Edition, including its added features, Support services,
18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20 from rhodecode.apps._base import add_route_with_slash
20 from rhodecode.apps._base import add_route_with_slash
21
21
22
22
23 def includeme(config):
23 def includeme(config):
24
24
25 # repo creating checks, special cases that aren't repo routes
25 # repo creating checks, special cases that aren't repo routes
26 config.add_route(
26 config.add_route(
27 name='repo_creating',
27 name='repo_creating',
28 pattern='/{repo_name:.*?[^/]}/repo_creating')
28 pattern='/{repo_name:.*?[^/]}/repo_creating')
29
29
30 config.add_route(
30 config.add_route(
31 name='repo_creating_check',
31 name='repo_creating_check',
32 pattern='/{repo_name:.*?[^/]}/repo_creating_check')
32 pattern='/{repo_name:.*?[^/]}/repo_creating_check')
33
33
34 # Summary
34 # Summary
35 # NOTE(marcink): one additional route is defined in very bottom, catch
35 # NOTE(marcink): one additional route is defined in very bottom, catch
36 # all pattern
36 # all pattern
37 config.add_route(
37 config.add_route(
38 name='repo_summary_explicit',
38 name='repo_summary_explicit',
39 pattern='/{repo_name:.*?[^/]}/summary', repo_route=True)
39 pattern='/{repo_name:.*?[^/]}/summary', repo_route=True)
40 config.add_route(
40 config.add_route(
41 name='repo_summary_commits',
41 name='repo_summary_commits',
42 pattern='/{repo_name:.*?[^/]}/summary-commits', repo_route=True)
42 pattern='/{repo_name:.*?[^/]}/summary-commits', repo_route=True)
43
43
44 # Commits
44 # Commits
45 config.add_route(
45 config.add_route(
46 name='repo_commit',
46 name='repo_commit',
47 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}', repo_route=True)
47 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}', repo_route=True)
48
48
49 config.add_route(
49 config.add_route(
50 name='repo_commit_children',
50 name='repo_commit_children',
51 pattern='/{repo_name:.*?[^/]}/changeset_children/{commit_id}', repo_route=True)
51 pattern='/{repo_name:.*?[^/]}/changeset_children/{commit_id}', repo_route=True)
52
52
53 config.add_route(
53 config.add_route(
54 name='repo_commit_parents',
54 name='repo_commit_parents',
55 pattern='/{repo_name:.*?[^/]}/changeset_parents/{commit_id}', repo_route=True)
55 pattern='/{repo_name:.*?[^/]}/changeset_parents/{commit_id}', repo_route=True)
56
56
57 config.add_route(
57 config.add_route(
58 name='repo_commit_raw',
58 name='repo_commit_raw',
59 pattern='/{repo_name:.*?[^/]}/changeset-diff/{commit_id}', repo_route=True)
59 pattern='/{repo_name:.*?[^/]}/changeset-diff/{commit_id}', repo_route=True)
60
60
61 config.add_route(
61 config.add_route(
62 name='repo_commit_patch',
62 name='repo_commit_patch',
63 pattern='/{repo_name:.*?[^/]}/changeset-patch/{commit_id}', repo_route=True)
63 pattern='/{repo_name:.*?[^/]}/changeset-patch/{commit_id}', repo_route=True)
64
64
65 config.add_route(
65 config.add_route(
66 name='repo_commit_download',
66 name='repo_commit_download',
67 pattern='/{repo_name:.*?[^/]}/changeset-download/{commit_id}', repo_route=True)
67 pattern='/{repo_name:.*?[^/]}/changeset-download/{commit_id}', repo_route=True)
68
68
69 config.add_route(
69 config.add_route(
70 name='repo_commit_data',
70 name='repo_commit_data',
71 pattern='/{repo_name:.*?[^/]}/changeset-data/{commit_id}', repo_route=True)
71 pattern='/{repo_name:.*?[^/]}/changeset-data/{commit_id}', repo_route=True)
72
72
73 config.add_route(
73 config.add_route(
74 name='repo_commit_comment_create',
74 name='repo_commit_comment_create',
75 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/create', repo_route=True)
75 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/create', repo_route=True)
76
76
77 config.add_route(
77 config.add_route(
78 name='repo_commit_comment_preview',
78 name='repo_commit_comment_preview',
79 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/preview', repo_route=True)
79 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/preview', repo_route=True)
80
80
81 config.add_route(
81 config.add_route(
82 name='repo_commit_comment_delete',
82 name='repo_commit_comment_delete',
83 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/{comment_id}/delete', repo_route=True)
83 pattern='/{repo_name:.*?[^/]}/changeset/{commit_id}/comment/{comment_id}/delete', repo_route=True)
84
84
85 # still working url for backward compat.
85 # still working url for backward compat.
86 config.add_route(
86 config.add_route(
87 name='repo_commit_raw_deprecated',
87 name='repo_commit_raw_deprecated',
88 pattern='/{repo_name:.*?[^/]}/raw-changeset/{commit_id}', repo_route=True)
88 pattern='/{repo_name:.*?[^/]}/raw-changeset/{commit_id}', repo_route=True)
89
89
90 # Files
90 # Files
91 config.add_route(
91 config.add_route(
92 name='repo_archivefile',
92 name='repo_archivefile',
93 pattern='/{repo_name:.*?[^/]}/archive/{fname}', repo_route=True)
93 pattern='/{repo_name:.*?[^/]}/archive/{fname:.*}', repo_route=True)
94
94
95 config.add_route(
95 config.add_route(
96 name='repo_files_diff',
96 name='repo_files_diff',
97 pattern='/{repo_name:.*?[^/]}/diff/{f_path:.*}', repo_route=True)
97 pattern='/{repo_name:.*?[^/]}/diff/{f_path:.*}', repo_route=True)
98 config.add_route( # legacy route to make old links work
98 config.add_route( # legacy route to make old links work
99 name='repo_files_diff_2way_redirect',
99 name='repo_files_diff_2way_redirect',
100 pattern='/{repo_name:.*?[^/]}/diff-2way/{f_path:.*}', repo_route=True)
100 pattern='/{repo_name:.*?[^/]}/diff-2way/{f_path:.*}', repo_route=True)
101
101
102 config.add_route(
102 config.add_route(
103 name='repo_files',
103 name='repo_files',
104 pattern='/{repo_name:.*?[^/]}/files/{commit_id}/{f_path:.*}', repo_route=True)
104 pattern='/{repo_name:.*?[^/]}/files/{commit_id}/{f_path:.*}', repo_route=True)
105 config.add_route(
105 config.add_route(
106 name='repo_files:default_path',
106 name='repo_files:default_path',
107 pattern='/{repo_name:.*?[^/]}/files/{commit_id}/', repo_route=True)
107 pattern='/{repo_name:.*?[^/]}/files/{commit_id}/', repo_route=True)
108 config.add_route(
108 config.add_route(
109 name='repo_files:default_commit',
109 name='repo_files:default_commit',
110 pattern='/{repo_name:.*?[^/]}/files', repo_route=True)
110 pattern='/{repo_name:.*?[^/]}/files', repo_route=True)
111
111
112 config.add_route(
112 config.add_route(
113 name='repo_files:rendered',
113 name='repo_files:rendered',
114 pattern='/{repo_name:.*?[^/]}/render/{commit_id}/{f_path:.*}', repo_route=True)
114 pattern='/{repo_name:.*?[^/]}/render/{commit_id}/{f_path:.*}', repo_route=True)
115
115
116 config.add_route(
116 config.add_route(
117 name='repo_files:annotated',
117 name='repo_files:annotated',
118 pattern='/{repo_name:.*?[^/]}/annotate/{commit_id}/{f_path:.*}', repo_route=True)
118 pattern='/{repo_name:.*?[^/]}/annotate/{commit_id}/{f_path:.*}', repo_route=True)
119 config.add_route(
119 config.add_route(
120 name='repo_files:annotated_previous',
120 name='repo_files:annotated_previous',
121 pattern='/{repo_name:.*?[^/]}/annotate-previous/{commit_id}/{f_path:.*}', repo_route=True)
121 pattern='/{repo_name:.*?[^/]}/annotate-previous/{commit_id}/{f_path:.*}', repo_route=True)
122
122
123 config.add_route(
123 config.add_route(
124 name='repo_nodetree_full',
124 name='repo_nodetree_full',
125 pattern='/{repo_name:.*?[^/]}/nodetree_full/{commit_id}/{f_path:.*}', repo_route=True)
125 pattern='/{repo_name:.*?[^/]}/nodetree_full/{commit_id}/{f_path:.*}', repo_route=True)
126 config.add_route(
126 config.add_route(
127 name='repo_nodetree_full:default_path',
127 name='repo_nodetree_full:default_path',
128 pattern='/{repo_name:.*?[^/]}/nodetree_full/{commit_id}/', repo_route=True)
128 pattern='/{repo_name:.*?[^/]}/nodetree_full/{commit_id}/', repo_route=True)
129
129
130 config.add_route(
130 config.add_route(
131 name='repo_files_nodelist',
131 name='repo_files_nodelist',
132 pattern='/{repo_name:.*?[^/]}/nodelist/{commit_id}/{f_path:.*}', repo_route=True)
132 pattern='/{repo_name:.*?[^/]}/nodelist/{commit_id}/{f_path:.*}', repo_route=True)
133
133
134 config.add_route(
134 config.add_route(
135 name='repo_file_raw',
135 name='repo_file_raw',
136 pattern='/{repo_name:.*?[^/]}/raw/{commit_id}/{f_path:.*}', repo_route=True)
136 pattern='/{repo_name:.*?[^/]}/raw/{commit_id}/{f_path:.*}', repo_route=True)
137
137
138 config.add_route(
138 config.add_route(
139 name='repo_file_download',
139 name='repo_file_download',
140 pattern='/{repo_name:.*?[^/]}/download/{commit_id}/{f_path:.*}', repo_route=True)
140 pattern='/{repo_name:.*?[^/]}/download/{commit_id}/{f_path:.*}', repo_route=True)
141 config.add_route( # backward compat to keep old links working
141 config.add_route( # backward compat to keep old links working
142 name='repo_file_download:legacy',
142 name='repo_file_download:legacy',
143 pattern='/{repo_name:.*?[^/]}/rawfile/{commit_id}/{f_path:.*}',
143 pattern='/{repo_name:.*?[^/]}/rawfile/{commit_id}/{f_path:.*}',
144 repo_route=True)
144 repo_route=True)
145
145
146 config.add_route(
146 config.add_route(
147 name='repo_file_history',
147 name='repo_file_history',
148 pattern='/{repo_name:.*?[^/]}/history/{commit_id}/{f_path:.*}', repo_route=True)
148 pattern='/{repo_name:.*?[^/]}/history/{commit_id}/{f_path:.*}', repo_route=True)
149
149
150 config.add_route(
150 config.add_route(
151 name='repo_file_authors',
151 name='repo_file_authors',
152 pattern='/{repo_name:.*?[^/]}/authors/{commit_id}/{f_path:.*}', repo_route=True)
152 pattern='/{repo_name:.*?[^/]}/authors/{commit_id}/{f_path:.*}', repo_route=True)
153
153
154 config.add_route(
154 config.add_route(
155 name='repo_files_remove_file',
155 name='repo_files_remove_file',
156 pattern='/{repo_name:.*?[^/]}/remove_file/{commit_id}/{f_path:.*}',
156 pattern='/{repo_name:.*?[^/]}/remove_file/{commit_id}/{f_path:.*}',
157 repo_route=True)
157 repo_route=True)
158 config.add_route(
158 config.add_route(
159 name='repo_files_delete_file',
159 name='repo_files_delete_file',
160 pattern='/{repo_name:.*?[^/]}/delete_file/{commit_id}/{f_path:.*}',
160 pattern='/{repo_name:.*?[^/]}/delete_file/{commit_id}/{f_path:.*}',
161 repo_route=True)
161 repo_route=True)
162 config.add_route(
162 config.add_route(
163 name='repo_files_edit_file',
163 name='repo_files_edit_file',
164 pattern='/{repo_name:.*?[^/]}/edit_file/{commit_id}/{f_path:.*}',
164 pattern='/{repo_name:.*?[^/]}/edit_file/{commit_id}/{f_path:.*}',
165 repo_route=True)
165 repo_route=True)
166 config.add_route(
166 config.add_route(
167 name='repo_files_update_file',
167 name='repo_files_update_file',
168 pattern='/{repo_name:.*?[^/]}/update_file/{commit_id}/{f_path:.*}',
168 pattern='/{repo_name:.*?[^/]}/update_file/{commit_id}/{f_path:.*}',
169 repo_route=True)
169 repo_route=True)
170 config.add_route(
170 config.add_route(
171 name='repo_files_add_file',
171 name='repo_files_add_file',
172 pattern='/{repo_name:.*?[^/]}/add_file/{commit_id}/{f_path:.*}',
172 pattern='/{repo_name:.*?[^/]}/add_file/{commit_id}/{f_path:.*}',
173 repo_route=True)
173 repo_route=True)
174 config.add_route(
174 config.add_route(
175 name='repo_files_create_file',
175 name='repo_files_create_file',
176 pattern='/{repo_name:.*?[^/]}/create_file/{commit_id}/{f_path:.*}',
176 pattern='/{repo_name:.*?[^/]}/create_file/{commit_id}/{f_path:.*}',
177 repo_route=True)
177 repo_route=True)
178
178
179 # Refs data
179 # Refs data
180 config.add_route(
180 config.add_route(
181 name='repo_refs_data',
181 name='repo_refs_data',
182 pattern='/{repo_name:.*?[^/]}/refs-data', repo_route=True)
182 pattern='/{repo_name:.*?[^/]}/refs-data', repo_route=True)
183
183
184 config.add_route(
184 config.add_route(
185 name='repo_refs_changelog_data',
185 name='repo_refs_changelog_data',
186 pattern='/{repo_name:.*?[^/]}/refs-data-changelog', repo_route=True)
186 pattern='/{repo_name:.*?[^/]}/refs-data-changelog', repo_route=True)
187
187
188 config.add_route(
188 config.add_route(
189 name='repo_stats',
189 name='repo_stats',
190 pattern='/{repo_name:.*?[^/]}/repo_stats/{commit_id}', repo_route=True)
190 pattern='/{repo_name:.*?[^/]}/repo_stats/{commit_id}', repo_route=True)
191
191
192 # Changelog
192 # Changelog
193 config.add_route(
193 config.add_route(
194 name='repo_changelog',
194 name='repo_changelog',
195 pattern='/{repo_name:.*?[^/]}/changelog', repo_route=True)
195 pattern='/{repo_name:.*?[^/]}/changelog', repo_route=True)
196 config.add_route(
196 config.add_route(
197 name='repo_changelog_file',
197 name='repo_changelog_file',
198 pattern='/{repo_name:.*?[^/]}/changelog/{commit_id}/{f_path:.*}', repo_route=True)
198 pattern='/{repo_name:.*?[^/]}/changelog/{commit_id}/{f_path:.*}', repo_route=True)
199 config.add_route(
199 config.add_route(
200 name='repo_changelog_elements',
200 name='repo_changelog_elements',
201 pattern='/{repo_name:.*?[^/]}/changelog_elements', repo_route=True)
201 pattern='/{repo_name:.*?[^/]}/changelog_elements', repo_route=True)
202 config.add_route(
202 config.add_route(
203 name='repo_changelog_elements_file',
203 name='repo_changelog_elements_file',
204 pattern='/{repo_name:.*?[^/]}/changelog_elements/{commit_id}/{f_path:.*}', repo_route=True)
204 pattern='/{repo_name:.*?[^/]}/changelog_elements/{commit_id}/{f_path:.*}', repo_route=True)
205
205
206 # Compare
206 # Compare
207 config.add_route(
207 config.add_route(
208 name='repo_compare_select',
208 name='repo_compare_select',
209 pattern='/{repo_name:.*?[^/]}/compare', repo_route=True)
209 pattern='/{repo_name:.*?[^/]}/compare', repo_route=True)
210
210
211 config.add_route(
211 config.add_route(
212 name='repo_compare',
212 name='repo_compare',
213 pattern='/{repo_name:.*?[^/]}/compare/{source_ref_type}@{source_ref:.*?}...{target_ref_type}@{target_ref:.*?}', repo_route=True)
213 pattern='/{repo_name:.*?[^/]}/compare/{source_ref_type}@{source_ref:.*?}...{target_ref_type}@{target_ref:.*?}', repo_route=True)
214
214
215 # Tags
215 # Tags
216 config.add_route(
216 config.add_route(
217 name='tags_home',
217 name='tags_home',
218 pattern='/{repo_name:.*?[^/]}/tags', repo_route=True)
218 pattern='/{repo_name:.*?[^/]}/tags', repo_route=True)
219
219
220 # Branches
220 # Branches
221 config.add_route(
221 config.add_route(
222 name='branches_home',
222 name='branches_home',
223 pattern='/{repo_name:.*?[^/]}/branches', repo_route=True)
223 pattern='/{repo_name:.*?[^/]}/branches', repo_route=True)
224
224
225 # Bookmarks
225 # Bookmarks
226 config.add_route(
226 config.add_route(
227 name='bookmarks_home',
227 name='bookmarks_home',
228 pattern='/{repo_name:.*?[^/]}/bookmarks', repo_route=True)
228 pattern='/{repo_name:.*?[^/]}/bookmarks', repo_route=True)
229
229
230 # Forks
230 # Forks
231 config.add_route(
231 config.add_route(
232 name='repo_fork_new',
232 name='repo_fork_new',
233 pattern='/{repo_name:.*?[^/]}/fork', repo_route=True,
233 pattern='/{repo_name:.*?[^/]}/fork', repo_route=True,
234 repo_forbid_when_archived=True,
234 repo_forbid_when_archived=True,
235 repo_accepted_types=['hg', 'git'])
235 repo_accepted_types=['hg', 'git'])
236
236
237 config.add_route(
237 config.add_route(
238 name='repo_fork_create',
238 name='repo_fork_create',
239 pattern='/{repo_name:.*?[^/]}/fork/create', repo_route=True,
239 pattern='/{repo_name:.*?[^/]}/fork/create', repo_route=True,
240 repo_forbid_when_archived=True,
240 repo_forbid_when_archived=True,
241 repo_accepted_types=['hg', 'git'])
241 repo_accepted_types=['hg', 'git'])
242
242
243 config.add_route(
243 config.add_route(
244 name='repo_forks_show_all',
244 name='repo_forks_show_all',
245 pattern='/{repo_name:.*?[^/]}/forks', repo_route=True,
245 pattern='/{repo_name:.*?[^/]}/forks', repo_route=True,
246 repo_accepted_types=['hg', 'git'])
246 repo_accepted_types=['hg', 'git'])
247 config.add_route(
247 config.add_route(
248 name='repo_forks_data',
248 name='repo_forks_data',
249 pattern='/{repo_name:.*?[^/]}/forks/data', repo_route=True,
249 pattern='/{repo_name:.*?[^/]}/forks/data', repo_route=True,
250 repo_accepted_types=['hg', 'git'])
250 repo_accepted_types=['hg', 'git'])
251
251
252 # Pull Requests
252 # Pull Requests
253 config.add_route(
253 config.add_route(
254 name='pullrequest_show',
254 name='pullrequest_show',
255 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}',
255 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}',
256 repo_route=True)
256 repo_route=True)
257
257
258 config.add_route(
258 config.add_route(
259 name='pullrequest_show_all',
259 name='pullrequest_show_all',
260 pattern='/{repo_name:.*?[^/]}/pull-request',
260 pattern='/{repo_name:.*?[^/]}/pull-request',
261 repo_route=True, repo_accepted_types=['hg', 'git'])
261 repo_route=True, repo_accepted_types=['hg', 'git'])
262
262
263 config.add_route(
263 config.add_route(
264 name='pullrequest_show_all_data',
264 name='pullrequest_show_all_data',
265 pattern='/{repo_name:.*?[^/]}/pull-request-data',
265 pattern='/{repo_name:.*?[^/]}/pull-request-data',
266 repo_route=True, repo_accepted_types=['hg', 'git'])
266 repo_route=True, repo_accepted_types=['hg', 'git'])
267
267
268 config.add_route(
268 config.add_route(
269 name='pullrequest_repo_refs',
269 name='pullrequest_repo_refs',
270 pattern='/{repo_name:.*?[^/]}/pull-request/refs/{target_repo_name:.*?[^/]}',
270 pattern='/{repo_name:.*?[^/]}/pull-request/refs/{target_repo_name:.*?[^/]}',
271 repo_route=True)
271 repo_route=True)
272
272
273 config.add_route(
273 config.add_route(
274 name='pullrequest_repo_targets',
274 name='pullrequest_repo_targets',
275 pattern='/{repo_name:.*?[^/]}/pull-request/repo-targets',
275 pattern='/{repo_name:.*?[^/]}/pull-request/repo-targets',
276 repo_route=True)
276 repo_route=True)
277
277
278 config.add_route(
278 config.add_route(
279 name='pullrequest_new',
279 name='pullrequest_new',
280 pattern='/{repo_name:.*?[^/]}/pull-request/new',
280 pattern='/{repo_name:.*?[^/]}/pull-request/new',
281 repo_route=True, repo_accepted_types=['hg', 'git'],
281 repo_route=True, repo_accepted_types=['hg', 'git'],
282 repo_forbid_when_archived=True)
282 repo_forbid_when_archived=True)
283
283
284 config.add_route(
284 config.add_route(
285 name='pullrequest_create',
285 name='pullrequest_create',
286 pattern='/{repo_name:.*?[^/]}/pull-request/create',
286 pattern='/{repo_name:.*?[^/]}/pull-request/create',
287 repo_route=True, repo_accepted_types=['hg', 'git'],
287 repo_route=True, repo_accepted_types=['hg', 'git'],
288 repo_forbid_when_archived=True)
288 repo_forbid_when_archived=True)
289
289
290 config.add_route(
290 config.add_route(
291 name='pullrequest_update',
291 name='pullrequest_update',
292 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/update',
292 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/update',
293 repo_route=True, repo_forbid_when_archived=True)
293 repo_route=True, repo_forbid_when_archived=True)
294
294
295 config.add_route(
295 config.add_route(
296 name='pullrequest_merge',
296 name='pullrequest_merge',
297 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/merge',
297 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/merge',
298 repo_route=True, repo_forbid_when_archived=True)
298 repo_route=True, repo_forbid_when_archived=True)
299
299
300 config.add_route(
300 config.add_route(
301 name='pullrequest_delete',
301 name='pullrequest_delete',
302 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/delete',
302 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/delete',
303 repo_route=True, repo_forbid_when_archived=True)
303 repo_route=True, repo_forbid_when_archived=True)
304
304
305 config.add_route(
305 config.add_route(
306 name='pullrequest_comment_create',
306 name='pullrequest_comment_create',
307 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment',
307 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment',
308 repo_route=True)
308 repo_route=True)
309
309
310 config.add_route(
310 config.add_route(
311 name='pullrequest_comment_delete',
311 name='pullrequest_comment_delete',
312 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment/{comment_id}/delete',
312 pattern='/{repo_name:.*?[^/]}/pull-request/{pull_request_id:\d+}/comment/{comment_id}/delete',
313 repo_route=True, repo_accepted_types=['hg', 'git'])
313 repo_route=True, repo_accepted_types=['hg', 'git'])
314
314
315 # Artifacts, (EE feature)
315 # Artifacts, (EE feature)
316 config.add_route(
316 config.add_route(
317 name='repo_artifacts_list',
317 name='repo_artifacts_list',
318 pattern='/{repo_name:.*?[^/]}/artifacts', repo_route=True)
318 pattern='/{repo_name:.*?[^/]}/artifacts', repo_route=True)
319
319
320 # Settings
320 # Settings
321 config.add_route(
321 config.add_route(
322 name='edit_repo',
322 name='edit_repo',
323 pattern='/{repo_name:.*?[^/]}/settings', repo_route=True)
323 pattern='/{repo_name:.*?[^/]}/settings', repo_route=True)
324 # update is POST on edit_repo
324 # update is POST on edit_repo
325
325
326 # Settings advanced
326 # Settings advanced
327 config.add_route(
327 config.add_route(
328 name='edit_repo_advanced',
328 name='edit_repo_advanced',
329 pattern='/{repo_name:.*?[^/]}/settings/advanced', repo_route=True)
329 pattern='/{repo_name:.*?[^/]}/settings/advanced', repo_route=True)
330 config.add_route(
330 config.add_route(
331 name='edit_repo_advanced_archive',
331 name='edit_repo_advanced_archive',
332 pattern='/{repo_name:.*?[^/]}/settings/advanced/archive', repo_route=True)
332 pattern='/{repo_name:.*?[^/]}/settings/advanced/archive', repo_route=True)
333 config.add_route(
333 config.add_route(
334 name='edit_repo_advanced_delete',
334 name='edit_repo_advanced_delete',
335 pattern='/{repo_name:.*?[^/]}/settings/advanced/delete', repo_route=True)
335 pattern='/{repo_name:.*?[^/]}/settings/advanced/delete', repo_route=True)
336 config.add_route(
336 config.add_route(
337 name='edit_repo_advanced_locking',
337 name='edit_repo_advanced_locking',
338 pattern='/{repo_name:.*?[^/]}/settings/advanced/locking', repo_route=True)
338 pattern='/{repo_name:.*?[^/]}/settings/advanced/locking', repo_route=True)
339 config.add_route(
339 config.add_route(
340 name='edit_repo_advanced_journal',
340 name='edit_repo_advanced_journal',
341 pattern='/{repo_name:.*?[^/]}/settings/advanced/journal', repo_route=True)
341 pattern='/{repo_name:.*?[^/]}/settings/advanced/journal', repo_route=True)
342 config.add_route(
342 config.add_route(
343 name='edit_repo_advanced_fork',
343 name='edit_repo_advanced_fork',
344 pattern='/{repo_name:.*?[^/]}/settings/advanced/fork', repo_route=True)
344 pattern='/{repo_name:.*?[^/]}/settings/advanced/fork', repo_route=True)
345
345
346 config.add_route(
346 config.add_route(
347 name='edit_repo_advanced_hooks',
347 name='edit_repo_advanced_hooks',
348 pattern='/{repo_name:.*?[^/]}/settings/advanced/hooks', repo_route=True)
348 pattern='/{repo_name:.*?[^/]}/settings/advanced/hooks', repo_route=True)
349
349
350 # Caches
350 # Caches
351 config.add_route(
351 config.add_route(
352 name='edit_repo_caches',
352 name='edit_repo_caches',
353 pattern='/{repo_name:.*?[^/]}/settings/caches', repo_route=True)
353 pattern='/{repo_name:.*?[^/]}/settings/caches', repo_route=True)
354
354
355 # Permissions
355 # Permissions
356 config.add_route(
356 config.add_route(
357 name='edit_repo_perms',
357 name='edit_repo_perms',
358 pattern='/{repo_name:.*?[^/]}/settings/permissions', repo_route=True)
358 pattern='/{repo_name:.*?[^/]}/settings/permissions', repo_route=True)
359
359
360 # Permissions Branch (EE feature)
360 # Permissions Branch (EE feature)
361 config.add_route(
361 config.add_route(
362 name='edit_repo_perms_branch',
362 name='edit_repo_perms_branch',
363 pattern='/{repo_name:.*?[^/]}/settings/branch_permissions', repo_route=True)
363 pattern='/{repo_name:.*?[^/]}/settings/branch_permissions', repo_route=True)
364 config.add_route(
364 config.add_route(
365 name='edit_repo_perms_branch_delete',
365 name='edit_repo_perms_branch_delete',
366 pattern='/{repo_name:.*?[^/]}/settings/branch_permissions/{rule_id}/delete',
366 pattern='/{repo_name:.*?[^/]}/settings/branch_permissions/{rule_id}/delete',
367 repo_route=True)
367 repo_route=True)
368
368
369 # Maintenance
369 # Maintenance
370 config.add_route(
370 config.add_route(
371 name='edit_repo_maintenance',
371 name='edit_repo_maintenance',
372 pattern='/{repo_name:.*?[^/]}/settings/maintenance', repo_route=True)
372 pattern='/{repo_name:.*?[^/]}/settings/maintenance', repo_route=True)
373
373
374 config.add_route(
374 config.add_route(
375 name='edit_repo_maintenance_execute',
375 name='edit_repo_maintenance_execute',
376 pattern='/{repo_name:.*?[^/]}/settings/maintenance/execute', repo_route=True)
376 pattern='/{repo_name:.*?[^/]}/settings/maintenance/execute', repo_route=True)
377
377
378 # Fields
378 # Fields
379 config.add_route(
379 config.add_route(
380 name='edit_repo_fields',
380 name='edit_repo_fields',
381 pattern='/{repo_name:.*?[^/]}/settings/fields', repo_route=True)
381 pattern='/{repo_name:.*?[^/]}/settings/fields', repo_route=True)
382 config.add_route(
382 config.add_route(
383 name='edit_repo_fields_create',
383 name='edit_repo_fields_create',
384 pattern='/{repo_name:.*?[^/]}/settings/fields/create', repo_route=True)
384 pattern='/{repo_name:.*?[^/]}/settings/fields/create', repo_route=True)
385 config.add_route(
385 config.add_route(
386 name='edit_repo_fields_delete',
386 name='edit_repo_fields_delete',
387 pattern='/{repo_name:.*?[^/]}/settings/fields/{field_id}/delete', repo_route=True)
387 pattern='/{repo_name:.*?[^/]}/settings/fields/{field_id}/delete', repo_route=True)
388
388
389 # Locking
389 # Locking
390 config.add_route(
390 config.add_route(
391 name='repo_edit_toggle_locking',
391 name='repo_edit_toggle_locking',
392 pattern='/{repo_name:.*?[^/]}/settings/toggle_locking', repo_route=True)
392 pattern='/{repo_name:.*?[^/]}/settings/toggle_locking', repo_route=True)
393
393
394 # Remote
394 # Remote
395 config.add_route(
395 config.add_route(
396 name='edit_repo_remote',
396 name='edit_repo_remote',
397 pattern='/{repo_name:.*?[^/]}/settings/remote', repo_route=True)
397 pattern='/{repo_name:.*?[^/]}/settings/remote', repo_route=True)
398 config.add_route(
398 config.add_route(
399 name='edit_repo_remote_pull',
399 name='edit_repo_remote_pull',
400 pattern='/{repo_name:.*?[^/]}/settings/remote/pull', repo_route=True)
400 pattern='/{repo_name:.*?[^/]}/settings/remote/pull', repo_route=True)
401 config.add_route(
401 config.add_route(
402 name='edit_repo_remote_push',
402 name='edit_repo_remote_push',
403 pattern='/{repo_name:.*?[^/]}/settings/remote/push', repo_route=True)
403 pattern='/{repo_name:.*?[^/]}/settings/remote/push', repo_route=True)
404
404
405 # Statistics
405 # Statistics
406 config.add_route(
406 config.add_route(
407 name='edit_repo_statistics',
407 name='edit_repo_statistics',
408 pattern='/{repo_name:.*?[^/]}/settings/statistics', repo_route=True)
408 pattern='/{repo_name:.*?[^/]}/settings/statistics', repo_route=True)
409 config.add_route(
409 config.add_route(
410 name='edit_repo_statistics_reset',
410 name='edit_repo_statistics_reset',
411 pattern='/{repo_name:.*?[^/]}/settings/statistics/update', repo_route=True)
411 pattern='/{repo_name:.*?[^/]}/settings/statistics/update', repo_route=True)
412
412
413 # Issue trackers
413 # Issue trackers
414 config.add_route(
414 config.add_route(
415 name='edit_repo_issuetracker',
415 name='edit_repo_issuetracker',
416 pattern='/{repo_name:.*?[^/]}/settings/issue_trackers', repo_route=True)
416 pattern='/{repo_name:.*?[^/]}/settings/issue_trackers', repo_route=True)
417 config.add_route(
417 config.add_route(
418 name='edit_repo_issuetracker_test',
418 name='edit_repo_issuetracker_test',
419 pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/test', repo_route=True)
419 pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/test', repo_route=True)
420 config.add_route(
420 config.add_route(
421 name='edit_repo_issuetracker_delete',
421 name='edit_repo_issuetracker_delete',
422 pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/delete', repo_route=True)
422 pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/delete', repo_route=True)
423 config.add_route(
423 config.add_route(
424 name='edit_repo_issuetracker_update',
424 name='edit_repo_issuetracker_update',
425 pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/update', repo_route=True)
425 pattern='/{repo_name:.*?[^/]}/settings/issue_trackers/update', repo_route=True)
426
426
427 # VCS Settings
427 # VCS Settings
428 config.add_route(
428 config.add_route(
429 name='edit_repo_vcs',
429 name='edit_repo_vcs',
430 pattern='/{repo_name:.*?[^/]}/settings/vcs', repo_route=True)
430 pattern='/{repo_name:.*?[^/]}/settings/vcs', repo_route=True)
431 config.add_route(
431 config.add_route(
432 name='edit_repo_vcs_update',
432 name='edit_repo_vcs_update',
433 pattern='/{repo_name:.*?[^/]}/settings/vcs/update', repo_route=True)
433 pattern='/{repo_name:.*?[^/]}/settings/vcs/update', repo_route=True)
434
434
435 # svn pattern
435 # svn pattern
436 config.add_route(
436 config.add_route(
437 name='edit_repo_vcs_svn_pattern_delete',
437 name='edit_repo_vcs_svn_pattern_delete',
438 pattern='/{repo_name:.*?[^/]}/settings/vcs/svn_pattern/delete', repo_route=True)
438 pattern='/{repo_name:.*?[^/]}/settings/vcs/svn_pattern/delete', repo_route=True)
439
439
440 # Repo Review Rules (EE feature)
440 # Repo Review Rules (EE feature)
441 config.add_route(
441 config.add_route(
442 name='repo_reviewers',
442 name='repo_reviewers',
443 pattern='/{repo_name:.*?[^/]}/settings/review/rules', repo_route=True)
443 pattern='/{repo_name:.*?[^/]}/settings/review/rules', repo_route=True)
444
444
445 config.add_route(
445 config.add_route(
446 name='repo_default_reviewers_data',
446 name='repo_default_reviewers_data',
447 pattern='/{repo_name:.*?[^/]}/settings/review/default-reviewers', repo_route=True)
447 pattern='/{repo_name:.*?[^/]}/settings/review/default-reviewers', repo_route=True)
448
448
449 # Repo Automation (EE feature)
449 # Repo Automation (EE feature)
450 config.add_route(
450 config.add_route(
451 name='repo_automation',
451 name='repo_automation',
452 pattern='/{repo_name:.*?[^/]}/settings/automation', repo_route=True)
452 pattern='/{repo_name:.*?[^/]}/settings/automation', repo_route=True)
453
453
454 # Strip
454 # Strip
455 config.add_route(
455 config.add_route(
456 name='edit_repo_strip',
456 name='edit_repo_strip',
457 pattern='/{repo_name:.*?[^/]}/settings/strip', repo_route=True)
457 pattern='/{repo_name:.*?[^/]}/settings/strip', repo_route=True)
458
458
459 config.add_route(
459 config.add_route(
460 name='strip_check',
460 name='strip_check',
461 pattern='/{repo_name:.*?[^/]}/settings/strip_check', repo_route=True)
461 pattern='/{repo_name:.*?[^/]}/settings/strip_check', repo_route=True)
462
462
463 config.add_route(
463 config.add_route(
464 name='strip_execute',
464 name='strip_execute',
465 pattern='/{repo_name:.*?[^/]}/settings/strip_execute', repo_route=True)
465 pattern='/{repo_name:.*?[^/]}/settings/strip_execute', repo_route=True)
466
466
467 # Audit logs
467 # Audit logs
468 config.add_route(
468 config.add_route(
469 name='edit_repo_audit_logs',
469 name='edit_repo_audit_logs',
470 pattern='/{repo_name:.*?[^/]}/settings/audit_logs', repo_route=True)
470 pattern='/{repo_name:.*?[^/]}/settings/audit_logs', repo_route=True)
471
471
472 # ATOM/RSS Feed
472 # ATOM/RSS Feed
473 config.add_route(
473 config.add_route(
474 name='rss_feed_home',
474 name='rss_feed_home',
475 pattern='/{repo_name:.*?[^/]}/feed/rss', repo_route=True)
475 pattern='/{repo_name:.*?[^/]}/feed/rss', repo_route=True)
476
476
477 config.add_route(
477 config.add_route(
478 name='atom_feed_home',
478 name='atom_feed_home',
479 pattern='/{repo_name:.*?[^/]}/feed/atom', repo_route=True)
479 pattern='/{repo_name:.*?[^/]}/feed/atom', repo_route=True)
480
480
481 # NOTE(marcink): needs to be at the end for catch-all
481 # NOTE(marcink): needs to be at the end for catch-all
482 add_route_with_slash(
482 add_route_with_slash(
483 config,
483 config,
484 name='repo_summary',
484 name='repo_summary',
485 pattern='/{repo_name:.*?[^/]}', repo_route=True)
485 pattern='/{repo_name:.*?[^/]}', repo_route=True)
486
486
487 # Scan module for configuration decorators.
487 # Scan module for configuration decorators.
488 config.scan('.views', ignore='.tests')
488 config.scan('.views', ignore='.tests')
General Comments 0
You need to be logged in to leave comments. Login now