diff --git a/pylons_app/__init__.py b/pylons_app/__init__.py --- a/pylons_app/__init__.py +++ b/pylons_app/__init__.py @@ -2,7 +2,7 @@ Hg app, a web based mercurial repository managment based on pylons """ -VERSION = (0, 6, 0, 'beta') +VERSION = (0, 6, 8, 'beta') __version__ = '.'.join((str(each) for each in VERSION[:4])) diff --git a/pylons_app/controllers/changeset.py b/pylons_app/controllers/changeset.py --- a/pylons_app/controllers/changeset.py +++ b/pylons_app/controllers/changeset.py @@ -1,20 +1,23 @@ -import logging - -from pylons import request, response, session, tmpl_context as c, url, config, app_globals as g +from pylons import request, response, session, tmpl_context as c, url, config, \ + app_globals as g from pylons.controllers.util import abort, redirect - +from pylons_app.lib.auth import LoginRequired 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 +import logging + + log = logging.getLogger(__name__) class ChangesetController(BaseController): + + @LoginRequired() def __before__(self): - c.repos_prefix = config['repos_name'] - c.repo_name = get_repo_slug(request) + super(ChangesetController, self).__before__() - def index(self): - # Return a rendered template - #return render('/changeset.mako') - # or, return a string - return 'Hello World' + def index(self, revision): + hg_model = HgModel() + c.changeset = hg_model.get_repo(c.repo_name).get_changeset(revision) + + return render('changeset/changeset.html') diff --git a/pylons_app/lib/utils.py b/pylons_app/lib/utils.py --- a/pylons_app/lib/utils.py +++ b/pylons_app/lib/utils.py @@ -53,7 +53,7 @@ def make_ui(path='hgwebdir.config', chec @param path: path to mercurial config file """ if not os.path.isfile(path): - log.error('Unable to read config file %s' % path) + log.warning('Unable to read config file %s' % path) return False #propagated from mercurial documentation sections = [ diff --git a/pylons_app/templates/changelog/changelog.html b/pylons_app/templates/changelog/changelog.html --- a/pylons_app/templates/changelog/changelog.html +++ b/pylons_app/templates/changelog/changelog.html @@ -1,7 +1,10 @@ +<%! +from pylons_app.lib import filters +%> <%inherit file="/base/base.html"/> <%def name="title()"> - ${_('Repository managment')} + ${_('Changelog - %s') % c.repo_name} <%def name="breadcrumbs()"> ${h.link_to(u'Home',h.url('/'))} @@ -11,104 +14,66 @@ ${_('changelog')} <%def name="page_nav()"> -
- -
- - ${self.menu('changelog')} + ${self.menu('changelog')} <%def name="main()"> -
-${h.form(h.url.current(),method='get')} - ${_('Show')}: ${h.text('size',size=5,value=c.size)} ${_('revisions')} - ${h.submit('','set')} -${h.end_form()} -
-
-
- -
-
- + +
+ ##
+ ## + ##
+
+
+ ${h.form(h.url.current(),method='get')} + ${_('Show')}: ${h.text('size',size=5,value=c.size)} ${_('revisions')} + ${h.submit('','set')} + ${h.end_form()} +
+ %for cnt,cs in enumerate(c.pagination): +
+
+
${_('commit')} ${cs.revision}: ${cs.raw_id}@${cs.date}
+
${cs.author}
+
+ ${h.link_to(cs.message, + h.url('changeset_home',repo_name=c.repo_name,revision=cs._short), + title=cs.message)} +
+ + ${cs.branch} + %for tag in cs.tags: + ${tag} + %endfor + +
+
+ ${len(cs.removed)} + ${len(cs.changed)} + ${len(cs.added)} +
+
+ + %endfor
- - -graph.render(data); - -// stop hiding script --> -

${c.pagination.pager('$link_previous ~2~ $link_next')}

diff --git a/pylons_app/templates/changeset/changeset.html b/pylons_app/templates/changeset/changeset.html new file mode 100644 --- /dev/null +++ b/pylons_app/templates/changeset/changeset.html @@ -0,0 +1,33 @@ +<%! +from pylons_app.lib import filters +%> +<%inherit file="/base/base.html"/> + +<%def name="title()"> + ${_('Changeset')} + +<%def name="breadcrumbs()"> + ${h.link_to(u'Home',h.url('/'))} + / + ${h.link_to(c.repo_name,h.url('changeset_home',repo_name=c.repo_name))} + / + ${_('changeset')} + +<%def name="page_nav()"> + ${self.menu('changelog')} + + +<%def name="main()"> + +
+ %for filenode in c.changeset.added: +

${filenode}

+ %endfor + %for filenode in c.changeset.changed: +

${filenode}

+ %endfor + %for filenode in c.changeset.removed: +

${filenode}

+ %endfor +
+ \ No newline at end of file diff --git a/pylons_app/templates/files/files_annotate.html b/pylons_app/templates/files/files_annotate.html new file mode 100644 --- /dev/null +++ b/pylons_app/templates/files/files_annotate.html @@ -0,0 +1,44 @@ +<%inherit file="/base/base.html"/> + +<%def name="title()"> + ${_('File annotate')} + +<%def name="breadcrumbs()"> + ${h.link_to(u'Home',h.url('/'))} + / + ${h.link_to(c.repo_name,h.url('files_home',repo_name=c.repo_name))} + / + ${_('files')} + +<%def name="page_nav()"> + ${self.menu('files')} + +<%def name="css()"> + + + +<%def name="main()"> + +
+

${_('Location')}: ${h.files_breadcrumbs(c.repo_name,c.cur_rev,c.file.path)}

+
+
${_('Revision')}
+
r${c.file.last_changeset.revision}:${c.file.last_changeset._short}
+
${_('Size')}
+
${h.format_byte_size(c.file.size,binary=True)}
+
${_('Options')}
+
${h.link_to(_('source'), + h.url('files_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.f_path))} / ${h.link_to(_('raw'), + h.url('files_raw_home',repo_name=c.repo_name,revision=c.cur_rev,f_path=c.f_path))}
+
+
+
+
${c.file.name}@r${c.file.last_changeset.revision}:${c.file.last_changeset._short}
+
"${c.file_msg}"
+
+
+ ${h.pygmentize_annotation(c.annotate,c.repo_name)} +
+
+
+ \ No newline at end of file