##// END OF EJS Templates
changed way of getting repository in changelog. + some code cleanups
marcink -
r276:5e59f29e default
parent child Browse files
Show More
@@ -25,7 +25,7 changelog controller for pylons
25 from pylons import request, session, tmpl_context as c
25 from pylons import request, session, tmpl_context as c
26 from pylons_app.lib.auth import LoginRequired
26 from pylons_app.lib.auth import LoginRequired
27 from pylons_app.lib.base import BaseController, render
27 from pylons_app.lib.base import BaseController, render
28 from pylons_app.model.hg_model import _full_changelog_cached
28 from pylons_app.model.hg_model import HgModel
29 from webhelpers.paginate import Page
29 from webhelpers.paginate import Page
30 import logging
30 import logging
31 log = logging.getLogger(__name__)
31 log = logging.getLogger(__name__)
@@ -51,7 +51,7 class ChangelogController(BaseController
51 else:
51 else:
52 c.size = session.get('changelog_size', default)
52 c.size = session.get('changelog_size', default)
53
53
54 changesets = _full_changelog_cached(c.repo_name)
54 changesets = HgModel().get_repo(c.repo_name)
55
55
56 p = int(request.params.get('page', 1))
56 p = int(request.params.get('page', 1))
57 c.pagination = Page(changesets, page=p, item_count=len(changesets),
57 c.pagination = Page(changesets, page=p, item_count=len(changesets),
@@ -38,9 +38,8 class ShortlogController(BaseController)
38 super(ShortlogController, self).__before__()
38 super(ShortlogController, self).__before__()
39
39
40 def index(self):
40 def index(self):
41 hg_model = HgModel()
42 p = int(request.params.get('page', 1))
41 p = int(request.params.get('page', 1))
43 repo = hg_model.get_repo(c.repo_name)
42 repo = HgModel().get_repo(c.repo_name)
44 c.repo_changesets = Page(repo, page=p, items_per_page=20)
43 c.repo_changesets = Page(repo, page=p, items_per_page=20)
45 c.shortlog_data = render('shortlog/shortlog_data.html')
44 c.shortlog_data = render('shortlog/shortlog_data.html')
46 if request.params.get('partial'):
45 if request.params.get('partial'):
@@ -53,6 +53,7 def _get_repos_cached():
53 """
53 """
54 return cached dict with repos
54 return cached dict with repos
55 """
55 """
56 log.info('getting all repositories list')
56 from pylons import app_globals as g
57 from pylons import app_globals as g
57 return HgModel.repo_scan(g.paths[0][0], g.paths[0][1], g.baseui)
58 return HgModel.repo_scan(g.paths[0][0], g.paths[0][1], g.baseui)
58
59
General Comments 0
You need to be logged in to leave comments. Login now