mercurial/templates/raw/graphnode.tmpl
author Anton Shestakov <av6@dwimlabs.net>
Mon, 20 Nov 2017 21:59:00 +0800
changeset 35096 23bba755cf80
parent 16773 d490edc71146
permissions -rw-r--r--
hgweb: use webutil.commonentry() for nodes (but not for jsdata yet) in /graph This makes graphdata() simpler by using existing code that gets common changeset properties for showing in hgweb. graphdata() is a nested function in graph() that prepares entries for /graph view, but there are two different lists of changesets prepared: "jsdata" for JavaScript-rendered graph and "nodes" for everything else. For "jsdata", properties "node", "user", "age" and "desc" are passed through various template filters because we don't have these filters in JavaScript, so the data has to be prepared server-side. But now that commonentry() is used for producing "nodes" list (and it doesn't apply any filters), these filters need to be added to the appropriate templates (only raw at this moment, everything else either doesn't implement graph or uses JavaScript). This is a bit of refactoring that will hopefully simplify future patches. The end result is to have /graph that only renders the actual graph with nodes and vertices in JavaScript, and the rest is done server-side. This way server-side code can focus on showing a list of changesets, which is easy because we already have /log, /shortlog, etc, and JavaScript code can be simplified, making it easier to add obsolescence graph and other features.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35096
23bba755cf80 hgweb: use webutil.commonentry() for nodes (but not for jsdata yet) in /graph
Anton Shestakov <av6@dwimlabs.net>
parents: 16773
diff changeset
     1
changeset:   {node|short}
23bba755cf80 hgweb: use webutil.commonentry() for nodes (but not for jsdata yet) in /graph
Anton Shestakov <av6@dwimlabs.net>
parents: 16773
diff changeset
     2
user:        {author|person}
23bba755cf80 hgweb: use webutil.commonentry() for nodes (but not for jsdata yet) in /graph
Anton Shestakov <av6@dwimlabs.net>
parents: 16773
diff changeset
     3
date:        {date|age}
23bba755cf80 hgweb: use webutil.commonentry() for nodes (but not for jsdata yet) in /graph
Anton Shestakov <av6@dwimlabs.net>
parents: 16773
diff changeset
     4
summary:     {desc|firstline|nonempty}
16773
d490edc71146 hgweb: make graph data suitable for template usage
Paul Boddie <paul@boddie.org.uk>
parents:
diff changeset
     5
{branches%branchname}{tags%tagname}{bookmarks%bookmarkname}
d490edc71146 hgweb: make graph data suitable for template usage
Paul Boddie <paul@boddie.org.uk>
parents:
diff changeset
     6
node:        ({col}, {row}) (color {color})
d490edc71146 hgweb: make graph data suitable for template usage
Paul Boddie <paul@boddie.org.uk>
parents:
diff changeset
     7
{edges%graphedge}