##// END OF EJS Templates
Moved check_repo function to utils, error controller check for first name in url, for this repo and only prints 404 make repo template if repo does not exists, moded check repo from admin
Moved check_repo function to utils, error controller check for first name in url, for this repo and only prints 404 make repo template if repo does not exists, moded check repo from admin

File last commit:

r107:5e2470eb default
r125:2811259d default
Show More
summary.py
32 lines | 1.3 KiB | text/x-python | PythonLexer
import logging
from pylons import tmpl_context as c, app_globals as g, session, request, config, url
from pylons.controllers.util import abort, redirect
from pylons_app.lib.base import BaseController, render
from pylons_app.lib.utils import get_repo_slug
from pylons_app.model.hg_model import HgModel
log = logging.getLogger(__name__)
class SummaryController(BaseController):
def __before__(self):
c.repos_prefix = config['repos_name']
c.repo_name = get_repo_slug(request)
def index(self):
hg_model = HgModel()
c.repo_info = hg_model.get_repo(c.repo_name)
c.repo_changesets = c.repo_info.get_changesets(10)
e = request.environ
uri = r'%(protocol)s://%(user)s@%(host)s/%(repo_name)s' % {
'protocol': e.get('wsgi.url_scheme'),
'user':e.get('REMOTE_USER'),
'host':e.get('HTTP_HOST'),
'repo_name':c.repo_name,
}
c.clone_repo_url = url(uri)
c.repo_tags = []#c.repo_info.get_tags(limit=10)
c.repo_branches = []#c.repo_info.get_branches(limit=10)
return render('/summary.html')