##// END OF EJS Templates
Basic compare-view controller with ref parsing
marcink -
r2241:b2a2868d codereview
parent child Browse files
Show More
@@ -0,0 +1,98 b''
1 # -*- coding: utf-8 -*-
2 """
3 rhodecode.controllers.compare
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5
6 compare controller for pylons showoing differences between two
7 repos, branches, bookmarks or tips
8
9 :created_on: May 6, 2012
10 :author: marcink
11 :copyright: (C) 2010-2012 Marcin Kuzminski <marcin@python-works.com>
12 :license: GPLv3, see COPYING for more details.
13 """
14 # This program is free software: you can redistribute it and/or modify
15 # it under the terms of the GNU General Public License as published by
16 # the Free Software Foundation, either version 3 of the License, or
17 # (at your option) any later version.
18 #
19 # This program is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU General Public License for more details.
23 #
24 # You should have received a copy of the GNU General Public License
25 # along with this program. If not, see <http://www.gnu.org/licenses/>.
26 import logging
27 import traceback
28
29 from pylons import request, response, session, tmpl_context as c, url
30 from pylons.controllers.util import abort, redirect
31
32 from rhodecode.lib.base import BaseRepoController, render
33 from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
34 from webob.exc import HTTPNotFound
35
36 log = logging.getLogger(__name__)
37
38
39 class CompareController(BaseRepoController):
40
41 @LoginRequired()
42 @HasRepoPermissionAnyDecorator('repository.read', 'repository.write',
43 'repository.admin')
44 def __before__(self):
45 super(CompareController, self).__before__()
46
47 def _handle_ref(self, ref):
48 """
49 Parse the org...other string
50 Possible formats are `(branch|book|tag):<name>...(branch|book|tag):<othername>`
51 or using a repo <empty>...(repo:</rhodecode/path/to/other)
52
53
54 :param ref:
55 :type ref:
56 """
57 org_repo = c.rhodecode_repo.name
58
59 def org_parser(org):
60 _repo = org_repo
61 name, val = org.split(':')
62 return _repo, (name, val)
63
64 def other_parser(other):
65 _repo = org_repo
66 name, val = other.split(':')
67 if 'repo' in other:
68 _repo = val
69 name = 'branch'
70 val = c.rhodecode_repo.DEFAULT_BRANCH_NAME
71
72 return _repo, (name, val)
73
74 if '...' in ref:
75 try:
76 org, other = ref.split('...')
77 org_repo, org_ref = org_parser(org)
78 other_repo, other_ref = other_parser(other)
79 return org_repo, org_ref, other_repo, other_ref
80 except:
81 log.error(traceback.format_exc())
82
83 raise HTTPNotFound
84
85 def index(self, ref):
86
87 org_repo, org_ref, other_repo, other_ref = self._handle_ref(ref)
88 return '''
89 <pre>
90 REPO: %s
91 REF: %s
92
93 vs
94
95 REPO: %s
96 REF: %s
97 </pre>
98 ''' % (org_repo, org_ref, other_repo, other_ref)
@@ -0,0 +1,7 b''
1 from rhodecode.tests import *
2
3 class TestCompareController(TestController):
4
5 def test_index(self):
6 response = self.app.get(url(controller='compare', action='index'))
7 # Test response...
@@ -1,507 +1,512 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 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 96 m.connect("/repos/{repo_name:.*}",
97 97 action="update", conditions=dict(method=["PUT"],
98 98 function=check_repo))
99 99 m.connect("/repos/{repo_name:.*}",
100 100 action="delete", conditions=dict(method=["DELETE"],
101 101 function=check_repo))
102 102 m.connect("edit_repo", "/repos/{repo_name:.*}/edit",
103 103 action="edit", conditions=dict(method=["GET"],
104 104 function=check_repo))
105 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 108 m.connect("repo", "/repos/{repo_name:.*}",
109 109 action="show", conditions=dict(method=["GET"],
110 110 function=check_repo))
111 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 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 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 126 m.connect('repo_stats', "/repos_stats/{repo_name:.*}",
127 127 action="repo_stats", conditions=dict(method=["DELETE"],
128 128 function=check_repo))
129 129 m.connect('repo_cache', "/repos_cache/{repo_name:.*}",
130 130 action="repo_cache", conditions=dict(method=["DELETE"],
131 131 function=check_repo))
132 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 135 m.connect('repo_pull', "/repo_pull/{repo_name:.*}",
136 136 action="repo_pull", conditions=dict(method=["PUT"],
137 137 function=check_repo))
138 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 function=check_int))
163 163 m.connect("formatted_edit_repos_group",
164 164 "/repos_groups/{id}.{format}/edit",
165 165 action="edit", conditions=dict(method=["GET"],
166 166 function=check_int))
167 167 m.connect("repos_group", "/repos_groups/{id}",
168 168 action="show", conditions=dict(method=["GET"],
169 169 function=check_int))
170 170 m.connect("formatted_repos_group", "/repos_groups/{id}.{format}",
171 171 action="show", conditions=dict(method=["GET"],
172 172 function=check_int))
173 173 # ajax delete repos group perm user
174 174 m.connect('delete_repos_group_user_perm',
175 175 "/delete_repos_group_user_perm/{group_name:.*}",
176 176 action="delete_repos_group_user_perm",
177 177 conditions=dict(method=["DELETE"], function=check_group))
178 178
179 179 # ajax delete repos group perm users_group
180 180 m.connect('delete_repos_group_users_group_perm',
181 181 "/delete_repos_group_users_group_perm/{group_name:.*}",
182 182 action="delete_repos_group_users_group_perm",
183 183 conditions=dict(method=["DELETE"], function=check_group))
184 184
185 185 #ADMIN USER REST ROUTES
186 186 with rmap.submapper(path_prefix=ADMIN_PREFIX,
187 187 controller='admin/users') as m:
188 188 m.connect("users", "/users",
189 189 action="create", conditions=dict(method=["POST"]))
190 190 m.connect("users", "/users",
191 191 action="index", conditions=dict(method=["GET"]))
192 192 m.connect("formatted_users", "/users.{format}",
193 193 action="index", conditions=dict(method=["GET"]))
194 194 m.connect("new_user", "/users/new",
195 195 action="new", conditions=dict(method=["GET"]))
196 196 m.connect("formatted_new_user", "/users/new.{format}",
197 197 action="new", conditions=dict(method=["GET"]))
198 198 m.connect("update_user", "/users/{id}",
199 199 action="update", conditions=dict(method=["PUT"]))
200 200 m.connect("delete_user", "/users/{id}",
201 201 action="delete", conditions=dict(method=["DELETE"]))
202 202 m.connect("edit_user", "/users/{id}/edit",
203 203 action="edit", conditions=dict(method=["GET"]))
204 204 m.connect("formatted_edit_user",
205 205 "/users/{id}.{format}/edit",
206 206 action="edit", conditions=dict(method=["GET"]))
207 207 m.connect("user", "/users/{id}",
208 208 action="show", conditions=dict(method=["GET"]))
209 209 m.connect("formatted_user", "/users/{id}.{format}",
210 210 action="show", conditions=dict(method=["GET"]))
211 211
212 212 #EXTRAS USER ROUTES
213 213 m.connect("user_perm", "/users_perm/{id}",
214 214 action="update_perm", conditions=dict(method=["PUT"]))
215 215
216 216 #ADMIN USERS REST ROUTES
217 217 with rmap.submapper(path_prefix=ADMIN_PREFIX,
218 218 controller='admin/users_groups') as m:
219 219 m.connect("users_groups", "/users_groups",
220 220 action="create", conditions=dict(method=["POST"]))
221 221 m.connect("users_groups", "/users_groups",
222 222 action="index", conditions=dict(method=["GET"]))
223 223 m.connect("formatted_users_groups", "/users_groups.{format}",
224 224 action="index", conditions=dict(method=["GET"]))
225 225 m.connect("new_users_group", "/users_groups/new",
226 226 action="new", conditions=dict(method=["GET"]))
227 227 m.connect("formatted_new_users_group", "/users_groups/new.{format}",
228 228 action="new", conditions=dict(method=["GET"]))
229 229 m.connect("update_users_group", "/users_groups/{id}",
230 230 action="update", conditions=dict(method=["PUT"]))
231 231 m.connect("delete_users_group", "/users_groups/{id}",
232 232 action="delete", conditions=dict(method=["DELETE"]))
233 233 m.connect("edit_users_group", "/users_groups/{id}/edit",
234 234 action="edit", conditions=dict(method=["GET"]))
235 235 m.connect("formatted_edit_users_group",
236 236 "/users_groups/{id}.{format}/edit",
237 237 action="edit", conditions=dict(method=["GET"]))
238 238 m.connect("users_group", "/users_groups/{id}",
239 239 action="show", conditions=dict(method=["GET"]))
240 240 m.connect("formatted_users_group", "/users_groups/{id}.{format}",
241 241 action="show", conditions=dict(method=["GET"]))
242 242
243 243 #EXTRAS USER ROUTES
244 244 m.connect("users_group_perm", "/users_groups_perm/{id}",
245 245 action="update_perm", conditions=dict(method=["PUT"]))
246 246
247 247 #ADMIN GROUP REST ROUTES
248 248 rmap.resource('group', 'groups',
249 249 controller='admin/groups', path_prefix=ADMIN_PREFIX)
250 250
251 251 #ADMIN PERMISSIONS REST ROUTES
252 252 rmap.resource('permission', 'permissions',
253 253 controller='admin/permissions', path_prefix=ADMIN_PREFIX)
254 254
255 255 ##ADMIN LDAP SETTINGS
256 256 rmap.connect('ldap_settings', '%s/ldap' % ADMIN_PREFIX,
257 257 controller='admin/ldap_settings', action='ldap_settings',
258 258 conditions=dict(method=["POST"]))
259 259
260 260 rmap.connect('ldap_home', '%s/ldap' % ADMIN_PREFIX,
261 261 controller='admin/ldap_settings')
262 262
263 263 #ADMIN SETTINGS REST ROUTES
264 264 with rmap.submapper(path_prefix=ADMIN_PREFIX,
265 265 controller='admin/settings') as m:
266 266 m.connect("admin_settings", "/settings",
267 267 action="create", conditions=dict(method=["POST"]))
268 268 m.connect("admin_settings", "/settings",
269 269 action="index", conditions=dict(method=["GET"]))
270 270 m.connect("formatted_admin_settings", "/settings.{format}",
271 271 action="index", conditions=dict(method=["GET"]))
272 272 m.connect("admin_new_setting", "/settings/new",
273 273 action="new", conditions=dict(method=["GET"]))
274 274 m.connect("formatted_admin_new_setting", "/settings/new.{format}",
275 275 action="new", conditions=dict(method=["GET"]))
276 276 m.connect("/settings/{setting_id}",
277 277 action="update", conditions=dict(method=["PUT"]))
278 278 m.connect("/settings/{setting_id}",
279 279 action="delete", conditions=dict(method=["DELETE"]))
280 280 m.connect("admin_edit_setting", "/settings/{setting_id}/edit",
281 281 action="edit", conditions=dict(method=["GET"]))
282 282 m.connect("formatted_admin_edit_setting",
283 283 "/settings/{setting_id}.{format}/edit",
284 284 action="edit", conditions=dict(method=["GET"]))
285 285 m.connect("admin_setting", "/settings/{setting_id}",
286 286 action="show", conditions=dict(method=["GET"]))
287 287 m.connect("formatted_admin_setting", "/settings/{setting_id}.{format}",
288 288 action="show", conditions=dict(method=["GET"]))
289 289 m.connect("admin_settings_my_account", "/my_account",
290 290 action="my_account", conditions=dict(method=["GET"]))
291 291 m.connect("admin_settings_my_account_update", "/my_account_update",
292 292 action="my_account_update", conditions=dict(method=["PUT"]))
293 293 m.connect("admin_settings_create_repository", "/create_repository",
294 294 action="create_repository", conditions=dict(method=["GET"]))
295 295
296 296 #NOTIFICATION REST ROUTES
297 297 with rmap.submapper(path_prefix=ADMIN_PREFIX,
298 298 controller='admin/notifications') as m:
299 299 m.connect("notifications", "/notifications",
300 300 action="create", conditions=dict(method=["POST"]))
301 301 m.connect("notifications", "/notifications",
302 302 action="index", conditions=dict(method=["GET"]))
303 303 m.connect("notifications_mark_all_read", "/notifications/mark_all_read",
304 304 action="mark_all_read", conditions=dict(method=["GET"]))
305 305 m.connect("formatted_notifications", "/notifications.{format}",
306 306 action="index", conditions=dict(method=["GET"]))
307 307 m.connect("new_notification", "/notifications/new",
308 308 action="new", conditions=dict(method=["GET"]))
309 309 m.connect("formatted_new_notification", "/notifications/new.{format}",
310 310 action="new", conditions=dict(method=["GET"]))
311 311 m.connect("/notification/{notification_id}",
312 312 action="update", conditions=dict(method=["PUT"]))
313 313 m.connect("/notification/{notification_id}",
314 314 action="delete", conditions=dict(method=["DELETE"]))
315 315 m.connect("edit_notification", "/notification/{notification_id}/edit",
316 316 action="edit", conditions=dict(method=["GET"]))
317 317 m.connect("formatted_edit_notification",
318 318 "/notification/{notification_id}.{format}/edit",
319 319 action="edit", conditions=dict(method=["GET"]))
320 320 m.connect("notification", "/notification/{notification_id}",
321 321 action="show", conditions=dict(method=["GET"]))
322 322 m.connect("formatted_notification", "/notifications/{notification_id}.{format}",
323 323 action="show", conditions=dict(method=["GET"]))
324 324
325 325 #ADMIN MAIN PAGES
326 326 with rmap.submapper(path_prefix=ADMIN_PREFIX,
327 327 controller='admin/admin') as m:
328 328 m.connect('admin_home', '', action='index')
329 329 m.connect('admin_add_repo', '/add_repo/{new_repo:[a-z0-9\. _-]*}',
330 330 action='add_repo')
331 331
332 332 #==========================================================================
333 333 # API V2
334 334 #==========================================================================
335 335 with rmap.submapper(path_prefix=ADMIN_PREFIX,
336 336 controller='api/api') as m:
337 337 m.connect('api', '/api')
338 338
339 339 #USER JOURNAL
340 340 rmap.connect('journal', '%s/journal' % ADMIN_PREFIX, controller='journal')
341 341
342 342 rmap.connect('public_journal', '%s/public_journal' % ADMIN_PREFIX,
343 343 controller='journal', action="public_journal")
344 344
345 345 rmap.connect('public_journal_rss', '%s/public_journal_rss' % ADMIN_PREFIX,
346 346 controller='journal', action="public_journal_rss")
347 347
348 348 rmap.connect('public_journal_atom',
349 349 '%s/public_journal_atom' % ADMIN_PREFIX, controller='journal',
350 350 action="public_journal_atom")
351 351
352 352 rmap.connect('toggle_following', '%s/toggle_following' % ADMIN_PREFIX,
353 353 controller='journal', action='toggle_following',
354 354 conditions=dict(method=["POST"]))
355 355
356 356 #SEARCH
357 357 rmap.connect('search', '%s/search' % ADMIN_PREFIX, controller='search',)
358 358 rmap.connect('search_repo', '%s/search/{search_repo:.*}' % ADMIN_PREFIX,
359 359 controller='search')
360 360
361 361 #LOGIN/LOGOUT/REGISTER/SIGN IN
362 362 rmap.connect('login_home', '%s/login' % ADMIN_PREFIX, controller='login')
363 363 rmap.connect('logout_home', '%s/logout' % ADMIN_PREFIX, controller='login',
364 364 action='logout')
365 365
366 366 rmap.connect('register', '%s/register' % ADMIN_PREFIX, controller='login',
367 367 action='register')
368 368
369 369 rmap.connect('reset_password', '%s/password_reset' % ADMIN_PREFIX,
370 370 controller='login', action='password_reset')
371 371
372 372 rmap.connect('reset_password_confirmation',
373 373 '%s/password_reset_confirmation' % ADMIN_PREFIX,
374 374 controller='login', action='password_reset_confirmation')
375 375
376 376 #FEEDS
377 377 rmap.connect('rss_feed_home', '/{repo_name:.*}/feed/rss',
378 378 controller='feed', action='rss',
379 379 conditions=dict(function=check_repo))
380 380
381 381 rmap.connect('atom_feed_home', '/{repo_name:.*}/feed/atom',
382 382 controller='feed', action='atom',
383 383 conditions=dict(function=check_repo))
384 384
385 385 #==========================================================================
386 386 # REPOSITORY ROUTES
387 387 #==========================================================================
388 388 rmap.connect('summary_home', '/{repo_name:.*}',
389 389 controller='summary',
390 390 conditions=dict(function=check_repo))
391 391
392 392 rmap.connect('repos_group_home', '/{group_name:.*}',
393 393 controller='admin/repos_groups', action="show_by_name",
394 394 conditions=dict(function=check_group))
395 395
396 396 rmap.connect('changeset_home', '/{repo_name:.*}/changeset/{revision}',
397 397 controller='changeset', revision='tip',
398 398 conditions=dict(function=check_repo))
399 399
400 400 rmap.connect('changeset_comment',
401 401 '/{repo_name:.*}/changeset/{revision}/comment',
402 402 controller='changeset', revision='tip', action='comment',
403 403 conditions=dict(function=check_repo))
404 404
405 405 rmap.connect('changeset_comment_delete',
406 406 '/{repo_name:.*}/changeset/comment/{comment_id}/delete',
407 407 controller='changeset', action='delete_comment',
408 408 conditions=dict(function=check_repo, method=["DELETE"]))
409 409
410 410 rmap.connect('raw_changeset_home',
411 411 '/{repo_name:.*}/raw-changeset/{revision}',
412 412 controller='changeset', action='raw_changeset',
413 413 revision='tip', conditions=dict(function=check_repo))
414 414
415 rmap.connect('compare_home',
416 '/{repo_name:.*}/compare/{ref:.*}',
417 controller='compare', action='index',
418 conditions=dict(function=check_repo))
419
415 420 rmap.connect('summary_home', '/{repo_name:.*}/summary',
416 421 controller='summary', conditions=dict(function=check_repo))
417 422
418 423 rmap.connect('shortlog_home', '/{repo_name:.*}/shortlog',
419 424 controller='shortlog', conditions=dict(function=check_repo))
420 425
421 426 rmap.connect('branches_home', '/{repo_name:.*}/branches',
422 427 controller='branches', conditions=dict(function=check_repo))
423 428
424 429 rmap.connect('tags_home', '/{repo_name:.*}/tags',
425 430 controller='tags', conditions=dict(function=check_repo))
426 431
427 432 rmap.connect('bookmarks_home', '/{repo_name:.*}/bookmarks',
428 433 controller='bookmarks', conditions=dict(function=check_repo))
429 434
430 435 rmap.connect('changelog_home', '/{repo_name:.*}/changelog',
431 436 controller='changelog', conditions=dict(function=check_repo))
432 437
433 438 rmap.connect('changelog_details', '/{repo_name:.*}/changelog_details/{cs}',
434 439 controller='changelog', action='changelog_details',
435 440 conditions=dict(function=check_repo))
436 441
437 442 rmap.connect('files_home', '/{repo_name:.*}/files/{revision}/{f_path:.*}',
438 443 controller='files', revision='tip', f_path='',
439 444 conditions=dict(function=check_repo))
440 445
441 446 rmap.connect('files_diff_home', '/{repo_name:.*}/diff/{f_path:.*}',
442 447 controller='files', action='diff', revision='tip', f_path='',
443 448 conditions=dict(function=check_repo))
444 449
445 450 rmap.connect('files_rawfile_home',
446 451 '/{repo_name:.*}/rawfile/{revision}/{f_path:.*}',
447 452 controller='files', action='rawfile', revision='tip',
448 453 f_path='', conditions=dict(function=check_repo))
449 454
450 455 rmap.connect('files_raw_home',
451 456 '/{repo_name:.*}/raw/{revision}/{f_path:.*}',
452 457 controller='files', action='raw', revision='tip', f_path='',
453 458 conditions=dict(function=check_repo))
454 459
455 460 rmap.connect('files_annotate_home',
456 461 '/{repo_name:.*}/annotate/{revision}/{f_path:.*}',
457 462 controller='files', action='index', revision='tip',
458 463 f_path='', annotate=True, conditions=dict(function=check_repo))
459 464
460 465 rmap.connect('files_edit_home',
461 466 '/{repo_name:.*}/edit/{revision}/{f_path:.*}',
462 467 controller='files', action='edit', revision='tip',
463 468 f_path='', conditions=dict(function=check_repo))
464 469
465 470 rmap.connect('files_add_home',
466 471 '/{repo_name:.*}/add/{revision}/{f_path:.*}',
467 472 controller='files', action='add', revision='tip',
468 473 f_path='', conditions=dict(function=check_repo))
469 474
470 475 rmap.connect('files_archive_home', '/{repo_name:.*}/archive/{fname}',
471 476 controller='files', action='archivefile',
472 477 conditions=dict(function=check_repo))
473 478
474 479 rmap.connect('files_nodelist_home',
475 480 '/{repo_name:.*}/nodelist/{revision}/{f_path:.*}',
476 481 controller='files', action='nodelist',
477 482 conditions=dict(function=check_repo))
478 483
479 484 rmap.connect('repo_settings_delete', '/{repo_name:.*}/settings',
480 485 controller='settings', action="delete",
481 486 conditions=dict(method=["DELETE"], function=check_repo))
482 487
483 488 rmap.connect('repo_settings_update', '/{repo_name:.*}/settings',
484 489 controller='settings', action="update",
485 490 conditions=dict(method=["PUT"], function=check_repo))
486 491
487 492 rmap.connect('repo_settings_home', '/{repo_name:.*}/settings',
488 493 controller='settings', action='index',
489 494 conditions=dict(function=check_repo))
490 495
491 496 rmap.connect('repo_fork_create_home', '/{repo_name:.*}/fork',
492 497 controller='forks', action='fork_create',
493 498 conditions=dict(function=check_repo, method=["POST"]))
494 499
495 500 rmap.connect('repo_fork_home', '/{repo_name:.*}/fork',
496 501 controller='forks', action='fork',
497 502 conditions=dict(function=check_repo))
498 503
499 504 rmap.connect('repo_forks_home', '/{repo_name:.*}/forks',
500 505 controller='forks', action='forks',
501 506 conditions=dict(function=check_repo))
502 507
503 508 rmap.connect('repo_followers_home', '/{repo_name:.*}/followers',
504 509 controller='followers', action='followers',
505 510 conditions=dict(function=check_repo))
506 511
507 512 return rmap
General Comments 0
You need to be logged in to leave comments. Login now