##// END OF EJS Templates
switched repo_name to non greedy match....
marcink -
r2692:1f75b23c beta
parent child Browse files
Show More
@@ -1,572 +1,571 b''
1 1 """
2 2 Routes configuration
3 3
4 4 The more specific and detailed routes should be defined first so they
5 5 may take precedent over the more generic routes. For more information
6 6 refer to the routes manual at http://routes.groovie.org/docs/
7 7 """
8 8 from __future__ import with_statement
9 9 from routes import Mapper
10 10
11 11 # prefix for non repository related links needs to be prefixed with `/`
12 12 ADMIN_PREFIX = '/_admin'
13 13
14 14
15 15 def make_map(config):
16 16 """Create, configure and return the routes Mapper"""
17 17 rmap = Mapper(directory=config['pylons.paths']['controllers'],
18 18 always_scan=config['debug'])
19 19 rmap.minimization = False
20 20 rmap.explicit = False
21 21
22 22 from rhodecode.lib.utils import is_valid_repo
23 23 from rhodecode.lib.utils import is_valid_repos_group
24 24
25 25 def check_repo(environ, match_dict):
26 26 """
27 27 check for valid repository for proper 404 handling
28 28
29 29 :param environ:
30 30 :param match_dict:
31 31 """
32 32 from rhodecode.model.db import Repository
33 33 repo_name = match_dict.get('repo_name')
34 34
35 35 try:
36 36 by_id = repo_name.split('_')
37 37 if len(by_id) == 2 and by_id[1].isdigit():
38 38 repo_name = Repository.get(by_id[1]).repo_name
39 39 match_dict['repo_name'] = repo_name
40 40 except:
41 41 pass
42 42
43 43 return is_valid_repo(repo_name, config['base_path'])
44 44
45 45 def check_group(environ, match_dict):
46 46 """
47 47 check for valid repositories group for proper 404 handling
48 48
49 49 :param environ:
50 50 :param match_dict:
51 51 """
52 52 repos_group_name = match_dict.get('group_name')
53 53
54 54 return is_valid_repos_group(repos_group_name, config['base_path'])
55 55
56 56 def check_int(environ, match_dict):
57 57 return match_dict.get('id').isdigit()
58 58
59 59 # The ErrorController route (handles 404/500 error pages); it should
60 60 # likely stay at the top, ensuring it can always be resolved
61 61 rmap.connect('/error/{action}', controller='error')
62 62 rmap.connect('/error/{action}/{id}', controller='error')
63 63
64 64 #==========================================================================
65 65 # CUSTOM ROUTES HERE
66 66 #==========================================================================
67 67
68 68 #MAIN PAGE
69 69 rmap.connect('home', '/', controller='home', action='index')
70 70 rmap.connect('repo_switcher', '/repos', controller='home',
71 71 action='repo_switcher')
72 rmap.connect('branch_tag_switcher', '/branches-tags/{repo_name:.*}',
72 rmap.connect('branch_tag_switcher', '/branches-tags/{repo_name:.*?}',
73 73 controller='home', action='branch_tag_switcher')
74 74 rmap.connect('bugtracker',
75 75 "http://bitbucket.org/marcinkuzminski/rhodecode/issues",
76 76 _static=True)
77 77 rmap.connect('rst_help',
78 78 "http://docutils.sourceforge.net/docs/user/rst/quickref.html",
79 79 _static=True)
80 80 rmap.connect('rhodecode_official', "http://rhodecode.org", _static=True)
81 81
82 82 #ADMIN REPOSITORY REST ROUTES
83 83 with rmap.submapper(path_prefix=ADMIN_PREFIX,
84 84 controller='admin/repos') as m:
85 85 m.connect("repos", "/repos",
86 86 action="create", conditions=dict(method=["POST"]))
87 87 m.connect("repos", "/repos",
88 88 action="index", conditions=dict(method=["GET"]))
89 89 m.connect("formatted_repos", "/repos.{format}",
90 90 action="index",
91 91 conditions=dict(method=["GET"]))
92 92 m.connect("new_repo", "/repos/new",
93 93 action="new", conditions=dict(method=["GET"]))
94 94 m.connect("formatted_new_repo", "/repos/new.{format}",
95 95 action="new", conditions=dict(method=["GET"]))
96 m.connect("/repos/{repo_name:.*}",
96 m.connect("/repos/{repo_name:.*?}",
97 97 action="update", conditions=dict(method=["PUT"],
98 98 function=check_repo))
99 m.connect("/repos/{repo_name:.*}",
99 m.connect("/repos/{repo_name:.*?}",
100 100 action="delete", conditions=dict(method=["DELETE"],
101 101 function=check_repo))
102 m.connect("edit_repo", "/repos/{repo_name:.*}/edit",
102 m.connect("edit_repo", "/repos/{repo_name:.*?}/edit",
103 103 action="edit", conditions=dict(method=["GET"],
104 104 function=check_repo))
105 m.connect("formatted_edit_repo", "/repos/{repo_name:.*}.{format}/edit",
105 m.connect("formatted_edit_repo", "/repos/{repo_name:.*?}.{format}/edit",
106 106 action="edit", conditions=dict(method=["GET"],
107 107 function=check_repo))
108 m.connect("repo", "/repos/{repo_name:.*}",
108 m.connect("repo", "/repos/{repo_name:.*?}",
109 109 action="show", conditions=dict(method=["GET"],
110 110 function=check_repo))
111 m.connect("formatted_repo", "/repos/{repo_name:.*}.{format}",
111 m.connect("formatted_repo", "/repos/{repo_name:.*?}.{format}",
112 112 action="show", conditions=dict(method=["GET"],
113 113 function=check_repo))
114 114 #ajax delete repo perm user
115 m.connect('delete_repo_user', "/repos_delete_user/{repo_name:.*}",
115 m.connect('delete_repo_user', "/repos_delete_user/{repo_name:.*?}",
116 116 action="delete_perm_user",
117 117 conditions=dict(method=["DELETE"], function=check_repo))
118 118
119 119 #ajax delete repo perm users_group
120 120 m.connect('delete_repo_users_group',
121 "/repos_delete_users_group/{repo_name:.*}",
121 "/repos_delete_users_group/{repo_name:.*?}",
122 122 action="delete_perm_users_group",
123 123 conditions=dict(method=["DELETE"], function=check_repo))
124 124
125 125 #settings actions
126 m.connect('repo_stats', "/repos_stats/{repo_name:.*}",
126 m.connect('repo_stats', "/repos_stats/{repo_name:.*?}",
127 127 action="repo_stats", conditions=dict(method=["DELETE"],
128 128 function=check_repo))
129 m.connect('repo_cache', "/repos_cache/{repo_name:.*}",
129 m.connect('repo_cache', "/repos_cache/{repo_name:.*?}",
130 130 action="repo_cache", conditions=dict(method=["DELETE"],
131 131 function=check_repo))
132 m.connect('repo_public_journal', "/repos_public_journal/{repo_name:.*}",
132 m.connect('repo_public_journal', "/repos_public_journal/{repo_name:.*?}",
133 133 action="repo_public_journal", conditions=dict(method=["PUT"],
134 134 function=check_repo))
135 m.connect('repo_pull', "/repo_pull/{repo_name:.*}",
135 m.connect('repo_pull', "/repo_pull/{repo_name:.*?}",
136 136 action="repo_pull", conditions=dict(method=["PUT"],
137 137 function=check_repo))
138 m.connect('repo_as_fork', "/repo_as_fork/{repo_name:.*}",
138 m.connect('repo_as_fork', "/repo_as_fork/{repo_name:.*?}",
139 139 action="repo_as_fork", conditions=dict(method=["PUT"],
140 140 function=check_repo))
141 141
142 142 with rmap.submapper(path_prefix=ADMIN_PREFIX,
143 143 controller='admin/repos_groups') as m:
144 144 m.connect("repos_groups", "/repos_groups",
145 145 action="create", conditions=dict(method=["POST"]))
146 146 m.connect("repos_groups", "/repos_groups",
147 147 action="index", conditions=dict(method=["GET"]))
148 148 m.connect("formatted_repos_groups", "/repos_groups.{format}",
149 149 action="index", conditions=dict(method=["GET"]))
150 150 m.connect("new_repos_group", "/repos_groups/new",
151 151 action="new", conditions=dict(method=["GET"]))
152 152 m.connect("formatted_new_repos_group", "/repos_groups/new.{format}",
153 153 action="new", conditions=dict(method=["GET"]))
154 154 m.connect("update_repos_group", "/repos_groups/{id}",
155 155 action="update", conditions=dict(method=["PUT"],
156 156 function=check_int))
157 157 m.connect("delete_repos_group", "/repos_groups/{id}",
158 158 action="delete", conditions=dict(method=["DELETE"],
159 159 function=check_int))
160 160 m.connect("edit_repos_group", "/repos_groups/{id}/edit",
161 161 action="edit", conditions=dict(method=["GET"],))
162 162 m.connect("formatted_edit_repos_group",
163 163 "/repos_groups/{id}.{format}/edit",
164 164 action="edit", conditions=dict(method=["GET"],
165 165 function=check_int))
166 166 m.connect("repos_group", "/repos_groups/{id}",
167 167 action="show", conditions=dict(method=["GET"],
168 168 function=check_int))
169 169 m.connect("formatted_repos_group", "/repos_groups/{id}.{format}",
170 170 action="show", conditions=dict(method=["GET"],
171 171 function=check_int))
172 172 # ajax delete repos group perm user
173 173 m.connect('delete_repos_group_user_perm',
174 174 "/delete_repos_group_user_perm/{group_name:.*}",
175 175 action="delete_repos_group_user_perm",
176 176 conditions=dict(method=["DELETE"], function=check_group))
177 177
178 178 # ajax delete repos group perm users_group
179 179 m.connect('delete_repos_group_users_group_perm',
180 180 "/delete_repos_group_users_group_perm/{group_name:.*}",
181 181 action="delete_repos_group_users_group_perm",
182 182 conditions=dict(method=["DELETE"], function=check_group))
183 183
184 184 #ADMIN USER REST ROUTES
185 185 with rmap.submapper(path_prefix=ADMIN_PREFIX,
186 186 controller='admin/users') as m:
187 187 m.connect("users", "/users",
188 188 action="create", conditions=dict(method=["POST"]))
189 189 m.connect("users", "/users",
190 190 action="index", conditions=dict(method=["GET"]))
191 191 m.connect("formatted_users", "/users.{format}",
192 192 action="index", conditions=dict(method=["GET"]))
193 193 m.connect("new_user", "/users/new",
194 194 action="new", conditions=dict(method=["GET"]))
195 195 m.connect("formatted_new_user", "/users/new.{format}",
196 196 action="new", conditions=dict(method=["GET"]))
197 197 m.connect("update_user", "/users/{id}",
198 198 action="update", conditions=dict(method=["PUT"]))
199 199 m.connect("delete_user", "/users/{id}",
200 200 action="delete", conditions=dict(method=["DELETE"]))
201 201 m.connect("edit_user", "/users/{id}/edit",
202 202 action="edit", conditions=dict(method=["GET"]))
203 203 m.connect("formatted_edit_user",
204 204 "/users/{id}.{format}/edit",
205 205 action="edit", conditions=dict(method=["GET"]))
206 206 m.connect("user", "/users/{id}",
207 207 action="show", conditions=dict(method=["GET"]))
208 208 m.connect("formatted_user", "/users/{id}.{format}",
209 209 action="show", conditions=dict(method=["GET"]))
210 210
211 211 #EXTRAS USER ROUTES
212 212 m.connect("user_perm", "/users_perm/{id}",
213 213 action="update_perm", conditions=dict(method=["PUT"]))
214 214 m.connect("user_emails", "/users_emails/{id}",
215 215 action="add_email", conditions=dict(method=["PUT"]))
216 216 m.connect("user_emails_delete", "/users_emails/{id}",
217 217 action="delete_email", conditions=dict(method=["DELETE"]))
218 218
219 219 #ADMIN USERS GROUPS REST ROUTES
220 220 with rmap.submapper(path_prefix=ADMIN_PREFIX,
221 221 controller='admin/users_groups') as m:
222 222 m.connect("users_groups", "/users_groups",
223 223 action="create", conditions=dict(method=["POST"]))
224 224 m.connect("users_groups", "/users_groups",
225 225 action="index", conditions=dict(method=["GET"]))
226 226 m.connect("formatted_users_groups", "/users_groups.{format}",
227 227 action="index", conditions=dict(method=["GET"]))
228 228 m.connect("new_users_group", "/users_groups/new",
229 229 action="new", conditions=dict(method=["GET"]))
230 230 m.connect("formatted_new_users_group", "/users_groups/new.{format}",
231 231 action="new", conditions=dict(method=["GET"]))
232 232 m.connect("update_users_group", "/users_groups/{id}",
233 233 action="update", conditions=dict(method=["PUT"]))
234 234 m.connect("delete_users_group", "/users_groups/{id}",
235 235 action="delete", conditions=dict(method=["DELETE"]))
236 236 m.connect("edit_users_group", "/users_groups/{id}/edit",
237 237 action="edit", conditions=dict(method=["GET"]))
238 238 m.connect("formatted_edit_users_group",
239 239 "/users_groups/{id}.{format}/edit",
240 240 action="edit", conditions=dict(method=["GET"]))
241 241 m.connect("users_group", "/users_groups/{id}",
242 242 action="show", conditions=dict(method=["GET"]))
243 243 m.connect("formatted_users_group", "/users_groups/{id}.{format}",
244 244 action="show", conditions=dict(method=["GET"]))
245 245
246 246 #EXTRAS USER ROUTES
247 247 m.connect("users_group_perm", "/users_groups_perm/{id}",
248 248 action="update_perm", conditions=dict(method=["PUT"]))
249 249
250 250 #ADMIN GROUP REST ROUTES
251 251 rmap.resource('group', 'groups',
252 252 controller='admin/groups', path_prefix=ADMIN_PREFIX)
253 253
254 254 #ADMIN PERMISSIONS REST ROUTES
255 255 rmap.resource('permission', 'permissions',
256 256 controller='admin/permissions', path_prefix=ADMIN_PREFIX)
257 257
258 258 ##ADMIN LDAP SETTINGS
259 259 rmap.connect('ldap_settings', '%s/ldap' % ADMIN_PREFIX,
260 260 controller='admin/ldap_settings', action='ldap_settings',
261 261 conditions=dict(method=["POST"]))
262 262
263 263 rmap.connect('ldap_home', '%s/ldap' % ADMIN_PREFIX,
264 264 controller='admin/ldap_settings')
265 265
266 266 #ADMIN SETTINGS REST ROUTES
267 267 with rmap.submapper(path_prefix=ADMIN_PREFIX,
268 268 controller='admin/settings') as m:
269 269 m.connect("admin_settings", "/settings",
270 270 action="create", conditions=dict(method=["POST"]))
271 271 m.connect("admin_settings", "/settings",
272 272 action="index", conditions=dict(method=["GET"]))
273 273 m.connect("formatted_admin_settings", "/settings.{format}",
274 274 action="index", conditions=dict(method=["GET"]))
275 275 m.connect("admin_new_setting", "/settings/new",
276 276 action="new", conditions=dict(method=["GET"]))
277 277 m.connect("formatted_admin_new_setting", "/settings/new.{format}",
278 278 action="new", conditions=dict(method=["GET"]))
279 279 m.connect("/settings/{setting_id}",
280 280 action="update", conditions=dict(method=["PUT"]))
281 281 m.connect("/settings/{setting_id}",
282 282 action="delete", conditions=dict(method=["DELETE"]))
283 283 m.connect("admin_edit_setting", "/settings/{setting_id}/edit",
284 284 action="edit", conditions=dict(method=["GET"]))
285 285 m.connect("formatted_admin_edit_setting",
286 286 "/settings/{setting_id}.{format}/edit",
287 287 action="edit", conditions=dict(method=["GET"]))
288 288 m.connect("admin_setting", "/settings/{setting_id}",
289 289 action="show", conditions=dict(method=["GET"]))
290 290 m.connect("formatted_admin_setting", "/settings/{setting_id}.{format}",
291 291 action="show", conditions=dict(method=["GET"]))
292 292 m.connect("admin_settings_my_account", "/my_account",
293 293 action="my_account", conditions=dict(method=["GET"]))
294 294 m.connect("admin_settings_my_account_update", "/my_account_update",
295 295 action="my_account_update", conditions=dict(method=["PUT"]))
296 296 m.connect("admin_settings_create_repository", "/create_repository",
297 297 action="create_repository", conditions=dict(method=["GET"]))
298 298 m.connect("admin_settings_my_repos", "/my_account/repos",
299 299 action="my_account_my_repos", conditions=dict(method=["GET"]))
300 300 m.connect("admin_settings_my_pullrequests", "/my_account/pull_requests",
301 301 action="my_account_my_pullrequests", conditions=dict(method=["GET"]))
302 302
303
304 303 #NOTIFICATION REST ROUTES
305 304 with rmap.submapper(path_prefix=ADMIN_PREFIX,
306 305 controller='admin/notifications') as m:
307 306 m.connect("notifications", "/notifications",
308 307 action="create", conditions=dict(method=["POST"]))
309 308 m.connect("notifications", "/notifications",
310 309 action="index", conditions=dict(method=["GET"]))
311 310 m.connect("notifications_mark_all_read", "/notifications/mark_all_read",
312 311 action="mark_all_read", conditions=dict(method=["GET"]))
313 312 m.connect("formatted_notifications", "/notifications.{format}",
314 313 action="index", conditions=dict(method=["GET"]))
315 314 m.connect("new_notification", "/notifications/new",
316 315 action="new", conditions=dict(method=["GET"]))
317 316 m.connect("formatted_new_notification", "/notifications/new.{format}",
318 317 action="new", conditions=dict(method=["GET"]))
319 318 m.connect("/notification/{notification_id}",
320 319 action="update", conditions=dict(method=["PUT"]))
321 320 m.connect("/notification/{notification_id}",
322 321 action="delete", conditions=dict(method=["DELETE"]))
323 322 m.connect("edit_notification", "/notification/{notification_id}/edit",
324 323 action="edit", conditions=dict(method=["GET"]))
325 324 m.connect("formatted_edit_notification",
326 325 "/notification/{notification_id}.{format}/edit",
327 326 action="edit", conditions=dict(method=["GET"]))
328 327 m.connect("notification", "/notification/{notification_id}",
329 328 action="show", conditions=dict(method=["GET"]))
330 329 m.connect("formatted_notification", "/notifications/{notification_id}.{format}",
331 330 action="show", conditions=dict(method=["GET"]))
332 331
333 332 #ADMIN MAIN PAGES
334 333 with rmap.submapper(path_prefix=ADMIN_PREFIX,
335 334 controller='admin/admin') as m:
336 335 m.connect('admin_home', '', action='index')
337 336 m.connect('admin_add_repo', '/add_repo/{new_repo:[a-z0-9\. _-]*}',
338 337 action='add_repo')
339 338
340 339 #==========================================================================
341 340 # API V2
342 341 #==========================================================================
343 342 with rmap.submapper(path_prefix=ADMIN_PREFIX,
344 343 controller='api/api') as m:
345 344 m.connect('api', '/api')
346 345
347 346 #USER JOURNAL
348 347 rmap.connect('journal', '%s/journal' % ADMIN_PREFIX,
349 348 controller='journal', action='index')
350 349 rmap.connect('journal_rss', '%s/journal/rss' % ADMIN_PREFIX,
351 350 controller='journal', action='journal_rss')
352 351 rmap.connect('journal_atom', '%s/journal/atom' % ADMIN_PREFIX,
353 352 controller='journal', action='journal_atom')
354 353
355 354 rmap.connect('public_journal', '%s/public_journal' % ADMIN_PREFIX,
356 355 controller='journal', action="public_journal")
357 356
358 357 rmap.connect('public_journal_rss', '%s/public_journal/rss' % ADMIN_PREFIX,
359 358 controller='journal', action="public_journal_rss")
360 359
361 360 rmap.connect('public_journal_rss_old', '%s/public_journal_rss' % ADMIN_PREFIX,
362 361 controller='journal', action="public_journal_rss")
363 362
364 363 rmap.connect('public_journal_atom',
365 364 '%s/public_journal/atom' % ADMIN_PREFIX, controller='journal',
366 365 action="public_journal_atom")
367 366
368 367 rmap.connect('public_journal_atom_old',
369 368 '%s/public_journal_atom' % ADMIN_PREFIX, controller='journal',
370 369 action="public_journal_atom")
371 370
372 371 rmap.connect('toggle_following', '%s/toggle_following' % ADMIN_PREFIX,
373 372 controller='journal', action='toggle_following',
374 373 conditions=dict(method=["POST"]))
375 374
376 375 #SEARCH
377 376 rmap.connect('search', '%s/search' % ADMIN_PREFIX, controller='search',)
378 377 rmap.connect('search_repo', '%s/search/{search_repo:.*}' % ADMIN_PREFIX,
379 378 controller='search')
380 379
381 380 #LOGIN/LOGOUT/REGISTER/SIGN IN
382 381 rmap.connect('login_home', '%s/login' % ADMIN_PREFIX, controller='login')
383 382 rmap.connect('logout_home', '%s/logout' % ADMIN_PREFIX, controller='login',
384 383 action='logout')
385 384
386 385 rmap.connect('register', '%s/register' % ADMIN_PREFIX, controller='login',
387 386 action='register')
388 387
389 388 rmap.connect('reset_password', '%s/password_reset' % ADMIN_PREFIX,
390 389 controller='login', action='password_reset')
391 390
392 391 rmap.connect('reset_password_confirmation',
393 392 '%s/password_reset_confirmation' % ADMIN_PREFIX,
394 393 controller='login', action='password_reset_confirmation')
395 394
396 395 #FEEDS
397 rmap.connect('rss_feed_home', '/{repo_name:.*}/feed/rss',
396 rmap.connect('rss_feed_home', '/{repo_name:.*?}/feed/rss',
398 397 controller='feed', action='rss',
399 398 conditions=dict(function=check_repo))
400 399
401 rmap.connect('atom_feed_home', '/{repo_name:.*}/feed/atom',
400 rmap.connect('atom_feed_home', '/{repo_name:.*?}/feed/atom',
402 401 controller='feed', action='atom',
403 402 conditions=dict(function=check_repo))
404 403
405 404 #==========================================================================
406 405 # REPOSITORY ROUTES
407 406 #==========================================================================
408 rmap.connect('summary_home', '/{repo_name:.*}',
407 rmap.connect('summary_home', '/{repo_name:.*?}',
409 408 controller='summary',
410 409 conditions=dict(function=check_repo))
411 410
412 411 rmap.connect('repos_group_home', '/{group_name:.*}',
413 412 controller='admin/repos_groups', action="show_by_name",
414 413 conditions=dict(function=check_group))
415 414
416 rmap.connect('changeset_home', '/{repo_name:.*}/changeset/{revision}',
415 rmap.connect('changeset_home', '/{repo_name:.*?}/changeset/{revision}',
417 416 controller='changeset', revision='tip',
418 417 conditions=dict(function=check_repo))
419 418
420 419 rmap.connect('changeset_comment',
421 '/{repo_name:.*}/changeset/{revision}/comment',
420 '/{repo_name:.*?}/changeset/{revision}/comment',
422 421 controller='changeset', revision='tip', action='comment',
423 422 conditions=dict(function=check_repo))
424 423
425 424 rmap.connect('changeset_comment_delete',
426 '/{repo_name:.*}/changeset/comment/{comment_id}/delete',
425 '/{repo_name:.*?}/changeset/comment/{comment_id}/delete',
427 426 controller='changeset', action='delete_comment',
428 427 conditions=dict(function=check_repo, method=["DELETE"]))
429 428
430 429 rmap.connect('raw_changeset_home',
431 '/{repo_name:.*}/raw-changeset/{revision}',
430 '/{repo_name:.*?}/raw-changeset/{revision}',
432 431 controller='changeset', action='raw_changeset',
433 432 revision='tip', conditions=dict(function=check_repo))
434 433
435 434 rmap.connect('compare_url',
436 '/{repo_name:.*}/compare/{org_ref_type}@{org_ref}...{other_ref_type}@{other_ref}',
435 '/{repo_name:.*?}/compare/{org_ref_type}@{org_ref}...{other_ref_type}@{other_ref}',
437 436 controller='compare', action='index',
438 437 conditions=dict(function=check_repo),
439 438 requirements=dict(org_ref_type='(branch|book|tag|rev)',
440 439 other_ref_type='(branch|book|tag|rev)'))
441 440
442 441 rmap.connect('pullrequest_home',
443 '/{repo_name:.*}/pull-request/new', controller='pullrequests',
442 '/{repo_name:.*?}/pull-request/new', controller='pullrequests',
444 443 action='index', conditions=dict(function=check_repo,
445 444 method=["GET"]))
446 445
447 446 rmap.connect('pullrequest',
448 '/{repo_name:.*}/pull-request/new', controller='pullrequests',
447 '/{repo_name:.*?}/pull-request/new', controller='pullrequests',
449 448 action='create', conditions=dict(function=check_repo,
450 449 method=["POST"]))
451 450
452 451 rmap.connect('pullrequest_show',
453 '/{repo_name:.*}/pull-request/{pull_request_id}',
452 '/{repo_name:.*?}/pull-request/{pull_request_id}',
454 453 controller='pullrequests',
455 454 action='show', conditions=dict(function=check_repo,
456 455 method=["GET"]))
457 456 rmap.connect('pullrequest_update',
458 '/{repo_name:.*}/pull-request/{pull_request_id}',
457 '/{repo_name:.*?}/pull-request/{pull_request_id}',
459 458 controller='pullrequests',
460 459 action='update', conditions=dict(function=check_repo,
461 460 method=["PUT"]))
462 461
463 462 rmap.connect('pullrequest_show_all',
464 '/{repo_name:.*}/pull-request',
463 '/{repo_name:.*?}/pull-request',
465 464 controller='pullrequests',
466 465 action='show_all', conditions=dict(function=check_repo,
467 466 method=["GET"]))
468 467
469 468 rmap.connect('pullrequest_comment',
470 '/{repo_name:.*}/pull-request-comment/{pull_request_id}',
469 '/{repo_name:.*?}/pull-request-comment/{pull_request_id}',
471 470 controller='pullrequests',
472 471 action='comment', conditions=dict(function=check_repo,
473 472 method=["POST"]))
474 473
475 474 rmap.connect('pullrequest_comment_delete',
476 '/{repo_name:.*}/pull-request-comment/{comment_id}/delete',
475 '/{repo_name:.*?}/pull-request-comment/{comment_id}/delete',
477 476 controller='pullrequests', action='delete_comment',
478 477 conditions=dict(function=check_repo, method=["DELETE"]))
479 478
480 rmap.connect('summary_home', '/{repo_name:.*}/summary',
479 rmap.connect('summary_home', '/{repo_name:.*?}/summary',
481 480 controller='summary', conditions=dict(function=check_repo))
482 481
483 rmap.connect('shortlog_home', '/{repo_name:.*}/shortlog',
482 rmap.connect('shortlog_home', '/{repo_name:.*?}/shortlog',
484 483 controller='shortlog', conditions=dict(function=check_repo))
485 484
486 rmap.connect('branches_home', '/{repo_name:.*}/branches',
485 rmap.connect('branches_home', '/{repo_name:.*?}/branches',
487 486 controller='branches', conditions=dict(function=check_repo))
488 487
489 rmap.connect('tags_home', '/{repo_name:.*}/tags',
488 rmap.connect('tags_home', '/{repo_name:.*?}/tags',
490 489 controller='tags', conditions=dict(function=check_repo))
491 490
492 rmap.connect('bookmarks_home', '/{repo_name:.*}/bookmarks',
491 rmap.connect('bookmarks_home', '/{repo_name:.*?}/bookmarks',
493 492 controller='bookmarks', conditions=dict(function=check_repo))
494 493
495 rmap.connect('changelog_home', '/{repo_name:.*}/changelog',
494 rmap.connect('changelog_home', '/{repo_name:.*?}/changelog',
496 495 controller='changelog', conditions=dict(function=check_repo))
497 496
498 rmap.connect('changelog_details', '/{repo_name:.*}/changelog_details/{cs}',
497 rmap.connect('changelog_details', '/{repo_name:.*?}/changelog_details/{cs}',
499 498 controller='changelog', action='changelog_details',
500 499 conditions=dict(function=check_repo))
501 500
502 rmap.connect('files_home', '/{repo_name:.*}/files/{revision}/{f_path:.*}',
501 rmap.connect('files_home', '/{repo_name:.*?}/files/{revision}/{f_path:.*}',
503 502 controller='files', revision='tip', f_path='',
504 503 conditions=dict(function=check_repo))
505 504
506 rmap.connect('files_diff_home', '/{repo_name:.*}/diff/{f_path:.*}',
505 rmap.connect('files_diff_home', '/{repo_name:.*?}/diff/{f_path:.*}',
507 506 controller='files', action='diff', revision='tip', f_path='',
508 507 conditions=dict(function=check_repo))
509 508
510 509 rmap.connect('files_rawfile_home',
511 '/{repo_name:.*}/rawfile/{revision}/{f_path:.*}',
510 '/{repo_name:.*?}/rawfile/{revision}/{f_path:.*}',
512 511 controller='files', action='rawfile', revision='tip',
513 512 f_path='', conditions=dict(function=check_repo))
514 513
515 514 rmap.connect('files_raw_home',
516 '/{repo_name:.*}/raw/{revision}/{f_path:.*}',
515 '/{repo_name:.*?}/raw/{revision}/{f_path:.*}',
517 516 controller='files', action='raw', revision='tip', f_path='',
518 517 conditions=dict(function=check_repo))
519 518
520 519 rmap.connect('files_annotate_home',
521 '/{repo_name:.*}/annotate/{revision}/{f_path:.*}',
520 '/{repo_name:.*?}/annotate/{revision}/{f_path:.*}',
522 521 controller='files', action='index', revision='tip',
523 522 f_path='', annotate=True, conditions=dict(function=check_repo))
524 523
525 524 rmap.connect('files_edit_home',
526 '/{repo_name:.*}/edit/{revision}/{f_path:.*}',
525 '/{repo_name:.*?}/edit/{revision}/{f_path:.*}',
527 526 controller='files', action='edit', revision='tip',
528 527 f_path='', conditions=dict(function=check_repo))
529 528
530 529 rmap.connect('files_add_home',
531 '/{repo_name:.*}/add/{revision}/{f_path:.*}',
530 '/{repo_name:.*?}/add/{revision}/{f_path:.*}',
532 531 controller='files', action='add', revision='tip',
533 532 f_path='', conditions=dict(function=check_repo))
534 533
535 rmap.connect('files_archive_home', '/{repo_name:.*}/archive/{fname}',
534 rmap.connect('files_archive_home', '/{repo_name:.*?}/archive/{fname}',
536 535 controller='files', action='archivefile',
537 536 conditions=dict(function=check_repo))
538 537
539 538 rmap.connect('files_nodelist_home',
540 '/{repo_name:.*}/nodelist/{revision}/{f_path:.*}',
539 '/{repo_name:.*?}/nodelist/{revision}/{f_path:.*}',
541 540 controller='files', action='nodelist',
542 541 conditions=dict(function=check_repo))
543 542
544 rmap.connect('repo_settings_delete', '/{repo_name:.*}/settings',
543 rmap.connect('repo_settings_delete', '/{repo_name:.*?}/settings',
545 544 controller='settings', action="delete",
546 545 conditions=dict(method=["DELETE"], function=check_repo))
547 546
548 rmap.connect('repo_settings_update', '/{repo_name:.*}/settings',
547 rmap.connect('repo_settings_update', '/{repo_name:.*?}/settings',
549 548 controller='settings', action="update",
550 549 conditions=dict(method=["PUT"], function=check_repo))
551 550
552 rmap.connect('repo_settings_home', '/{repo_name:.*}/settings',
551 rmap.connect('repo_settings_home', '/{repo_name:.*?}/settings',
553 552 controller='settings', action='index',
554 553 conditions=dict(function=check_repo))
555 554
556 rmap.connect('repo_fork_create_home', '/{repo_name:.*}/fork',
555 rmap.connect('repo_fork_create_home', '/{repo_name:.*?}/fork',
557 556 controller='forks', action='fork_create',
558 557 conditions=dict(function=check_repo, method=["POST"]))
559 558
560 rmap.connect('repo_fork_home', '/{repo_name:.*}/fork',
559 rmap.connect('repo_fork_home', '/{repo_name:.*?}/fork',
561 560 controller='forks', action='fork',
562 561 conditions=dict(function=check_repo))
563 562
564 rmap.connect('repo_forks_home', '/{repo_name:.*}/forks',
563 rmap.connect('repo_forks_home', '/{repo_name:.*?}/forks',
565 564 controller='forks', action='forks',
566 565 conditions=dict(function=check_repo))
567 566
568 rmap.connect('repo_followers_home', '/{repo_name:.*}/followers',
567 rmap.connect('repo_followers_home', '/{repo_name:.*?}/followers',
569 568 controller='followers', action='followers',
570 569 conditions=dict(function=check_repo))
571 570
572 571 return rmap
General Comments 0
You need to be logged in to leave comments. Login now