comparison pylons_app/controllers/graph.py @ 289:237470e64bb8

switched filters into webhelpers for easy of usage. Rewrite of html to use predefined templates from branches shortlog tags, for DRY usage. Added info messages about empty branches/tags etc.
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 13 Jun 2010 23:56:16 +0200
parents 3782a6d698af
children
comparison
equal deleted inserted replaced
288:cd2ee462fc2c 289:237470e64bb8
23 @author: marcink 23 @author: marcink
24 """ 24 """
25 from mercurial.graphmod import revisions as graph_rev, colored, CHANGESET 25 from mercurial.graphmod import revisions as graph_rev, colored, CHANGESET
26 from mercurial.node import short 26 from mercurial.node import short
27 from pylons import request, tmpl_context as c 27 from pylons import request, tmpl_context as c
28 import pylons_app.lib.helpers as h
28 from pylons_app.lib.auth import LoginRequired 29 from pylons_app.lib.auth import LoginRequired
29 from pylons_app.lib.base import BaseController, render 30 from pylons_app.lib.base import BaseController, render
30 from pylons_app.lib.filters import age as _age, person
31 from pylons_app.model.hg_model import HgModel 31 from pylons_app.model.hg_model import HgModel
32 from simplejson import dumps 32 from simplejson import dumps
33 from webhelpers.paginate import Page 33 from webhelpers.paginate import Page
34 import logging 34 import logging
35 35
72 data = [] 72 data = []
73 for (id, type, ctx, vtx, edges) in tree: 73 for (id, type, ctx, vtx, edges) in tree:
74 if type != CHANGESET: 74 if type != CHANGESET:
75 continue 75 continue
76 node = short(ctx.node()) 76 node = short(ctx.node())
77 age = _age(ctx.date()) 77 age = h.age(ctx.date())
78 desc = ctx.description() 78 desc = ctx.description()
79 user = person(ctx.user()) 79 user = h.person(ctx.user())
80 branch = ctx.branch() 80 branch = ctx.branch()
81 branch = branch, repo.repo.branchtags().get(branch) == ctx.node() 81 branch = branch, repo.repo.branchtags().get(branch) == ctx.node()
82 data.append((node, vtx, edges, desc, user, age, branch, ctx.tags())) 82 data.append((node, vtx, edges, desc, user, age, branch, ctx.tags()))
83 83
84 return dumps(data), canvasheight 84 return dumps(data), canvasheight