# HG changeset patch # User Marcin Kuzminski # Date 1276437407 -7200 # Node ID 7ec4463b6e532fb5a312eaee2463f251d71a7b14 # Parent 5e59f29edf661290575f819f35b328bf58974477 fixed branches and tags, fetching for new vcs implementation diff -r 5e59f29edf66 -r 7ec4463b6e53 pylons_app/controllers/branches.py --- a/pylons_app/controllers/branches.py Fri Jun 11 16:52:00 2010 +0200 +++ b/pylons_app/controllers/branches.py Sun Jun 13 15:56:47 2010 +0200 @@ -22,7 +22,7 @@ branches controller for pylons @author: marcink """ -from pylons import tmpl_context as c, app_globals as g +from pylons import tmpl_context as c from pylons_app.lib.auth import LoginRequired from pylons_app.lib.base import BaseController, render from pylons_app.model.hg_model import HgModel @@ -39,6 +39,8 @@ def index(self): hg_model = HgModel() c.repo_info = hg_model.get_repo(c.repo_name) - c.repo_branches = c.repo_info.branches + c.repo_branches = {} + for name, hash in c.repo_info.branches.items(): + c.repo_branches[name] = c.repo_info.get_changeset(hash) return render('branches/branches.html') diff -r 5e59f29edf66 -r 7ec4463b6e53 pylons_app/controllers/summary.py --- a/pylons_app/controllers/summary.py Fri Jun 11 16:52:00 2010 +0200 +++ b/pylons_app/controllers/summary.py Sun Jun 13 15:56:47 2010 +0200 @@ -47,6 +47,12 @@ 'host':e.get('HTTP_HOST'), 'repo_name':c.repo_name, } c.clone_repo_url = uri - c.repo_tags = c.repo_info.tags[:10] - c.repo_branches = c.repo_info.branches[:10] + c.repo_tags = {} + for name, hash in c.repo_info.tags.items()[:10]: + c.repo_tags[name] = c.repo_info.get_changeset(hash) + + c.repo_branches = {} + for name, hash in c.repo_info.branches.items()[:10]: + c.repo_branches[name] = c.repo_info.get_changeset(hash) + return render('summary/summary.html') diff -r 5e59f29edf66 -r 7ec4463b6e53 pylons_app/controllers/tags.py --- a/pylons_app/controllers/tags.py Fri Jun 11 16:52:00 2010 +0200 +++ b/pylons_app/controllers/tags.py Sun Jun 13 15:56:47 2010 +0200 @@ -39,6 +39,8 @@ def index(self): hg_model = HgModel() c.repo_info = hg_model.get_repo(c.repo_name) - c.repo_tags = c.repo_info.tags + c.repo_tags = {} + for name, hash in c.repo_info.tags.items(): + c.repo_tags[name] = c.repo_info.get_changeset(hash) return render('tags/tags.html') diff -r 5e59f29edf66 -r 7ec4463b6e53 pylons_app/templates/branches/branches.html --- a/pylons_app/templates/branches/branches.html Fri Jun 11 16:52:00 2010 +0200 +++ b/pylons_app/templates/branches/branches.html Sun Jun 13 15:56:47 2010 +0200 @@ -18,18 +18,19 @@ - %for cnt,branch in enumerate(c.repo_branches): + %for cnt,branch in enumerate(c.repo_branches.items()): - + %endfor diff -r 5e59f29edf66 -r 7ec4463b6e53 pylons_app/templates/shortlog/shortlog_data.html --- a/pylons_app/templates/shortlog/shortlog_data.html Fri Jun 11 16:52:00 2010 +0200 +++ b/pylons_app/templates/shortlog/shortlog_data.html Sun Jun 13 15:56:47 2010 +0200 @@ -22,9 +22,9 @@ %endfor diff -r 5e59f29edf66 -r 7ec4463b6e53 pylons_app/templates/summary/summary.html --- a/pylons_app/templates/summary/summary.html Fri Jun 11 16:52:00 2010 +0200 +++ b/pylons_app/templates/summary/summary.html Sun Jun 13 15:56:47 2010 +0200 @@ -93,18 +93,19 @@

${h.link_to(_('Tags'),h.url('tags_home',repo_name=c.repo_name))}

${branch._ctx.date()|n,filters.age}${branch[1]._ctx.date()|n,filters.age} - ${h.link_to(branch.branch,h.url('changeset_home',repo_name=c.repo_name,revision=branch._short))} + ${h.link_to(branch[0], + h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))} - ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=branch._short))} + ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))} | - ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=branch._short))} + ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=branch[1].raw_id))}
- ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=cs._short))} + ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id))} | - ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=cs._short))} + ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))}
- %for cnt,tag in enumerate(c.repo_tags): + %for cnt,tag in enumerate(c.repo_tags.items()): - + %endfor @@ -112,18 +113,19 @@

${h.link_to(_('Branches'),h.url('branches_home',repo_name=c.repo_name))}

${tag._ctx.date()|n,filters.age}${tag[1]._ctx.date()|n,filters.age} - ${h.link_to(tag.tags[-1],h.url('changeset_home',repo_name=c.repo_name,revision=tag._short))} + ${h.link_to(tag[0], + h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].raw_id))} - ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=tag._short))} + ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].raw_id))} | - ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=tag._short))} + ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=tag[1].raw_id))}
- %for cnt,branch in enumerate(c.repo_branches): + %for cnt,branch in enumerate(c.repo_branches.items()): - + %endfor diff -r 5e59f29edf66 -r 7ec4463b6e53 pylons_app/templates/tags/tags.html --- a/pylons_app/templates/tags/tags.html Fri Jun 11 16:52:00 2010 +0200 +++ b/pylons_app/templates/tags/tags.html Sun Jun 13 15:56:47 2010 +0200 @@ -18,20 +18,20 @@ <%def name="main()"> -
${branch._ctx.date()|n,filters.age}${branch[1]._ctx.date()|n,filters.age} - ${h.link_to(branch.branch,h.url('changeset_home',repo_name=c.repo_name,revision=branch._short))} + ${h.link_to(branch[0], + h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))} - ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=branch._short))} + ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=branch[1].raw_id))} | - ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=branch._short))} + ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=branch[1].raw_id))}
- %for cnt,tag in enumerate(c.repo_tags): + %for cnt,tag in enumerate(c.repo_tags.items()): - + %endfor
${tag._ctx.date()|n,filters.age}${tag[1]._ctx.date()|n,filters.age} - ${h.link_to(tag.tags[-1],h.url('changeset_home',repo_name=c.repo_name,revision=tag._short))} + ${h.link_to(tag[0], + h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].raw_id))} - ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=tag._short))} + ${h.link_to(_('changeset'),h.url('changeset_home',repo_name=c.repo_name,revision=tag[1].raw_id))} | - ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=tag._short))} + ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=tag[1].raw_id))}