|
1 {header} |
|
2 <title>{repo|escape}: Graph</title> |
|
3 <link rel="alternate" type="application/atom+xml" |
|
4 href="{url}atom-log" title="Atom feed for {repo|escape}"/> |
|
5 <link rel="alternate" type="application/rss+xml" |
|
6 href="{url}rss-log" title="RSS feed for {repo|escape}"/> |
|
7 <!--[if IE]><script type="text/javascript" src="{staticurl}excanvas.js"></script><![endif]--> |
|
8 </head> |
|
9 <body> |
|
10 |
|
11 <div class="page_header"> |
|
12 <a href="http://mercurial.selenic.com/" title="Mercurial" style="float: right;">Mercurial</a><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / graph |
|
13 </div> |
|
14 |
|
15 <form action="{url}log"> |
|
16 {sessionvars%hiddenformentry} |
|
17 <div class="search"> |
|
18 <input type="text" name="rev" /> |
|
19 </div> |
|
20 </form> |
|
21 <div class="page_nav"> |
|
22 <a href="{url}summary{sessionvars%urlparameter}">summary</a> | |
|
23 <a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a> | |
|
24 <a href="{url}log/{rev}{sessionvars%urlparameter}">changelog</a> | |
|
25 graph | |
|
26 <a href="{url}tags{sessionvars%urlparameter}">tags</a> | |
|
27 <a href="{url}branches{sessionvars%urlparameter}">branches</a> | |
|
28 <a href="{url}file/{node|short}{sessionvars%urlparameter}">files</a> | |
|
29 <a href="{url}help{sessionvars%urlparameter}">help</a> |
|
30 <br/> |
|
31 <a href="{url}graph/{rev}{lessvars%urlparameter}">less</a> |
|
32 <a href="{url}graph/{rev}{morevars%urlparameter}">more</a> |
|
33 | {changenav%navgraph}<br/> |
|
34 </div> |
|
35 |
|
36 <div class="title"> </div> |
|
37 |
|
38 <noscript>The revision graph only works with JavaScript-enabled browsers.</noscript> |
|
39 |
|
40 <div id="wrapper"> |
|
41 <ul id="nodebgs"></ul> |
|
42 <canvas id="graph" width="224" height="{canvasheight}"></canvas> |
|
43 <ul id="graphnodes"></ul> |
|
44 </div> |
|
45 |
|
46 <script type="text/javascript" src="{staticurl}graph.js"></script> |
|
47 <script> |
|
48 <!-- hide script content |
|
49 |
|
50 var data = {jsdata|json}; |
|
51 var graph = new Graph(); |
|
52 graph.scale({bg_height}); |
|
53 |
|
54 graph.edge = function(x0, y0, x1, y1, color) \{ |
|
55 |
|
56 this.setColor(color, 0.0, 0.65); |
|
57 this.ctx.beginPath(); |
|
58 this.ctx.moveTo(x0, y0); |
|
59 this.ctx.lineTo(x1, y1); |
|
60 this.ctx.stroke(); |
|
61 |
|
62 } |
|
63 |
|
64 var revlink = '<li style="_STYLE"><span class="desc">'; |
|
65 revlink += '<a class="list" href="{url}rev/_NODEID{sessionvars%urlparameter}" title="_NODEID"><b>_DESC</b></a>'; |
|
66 revlink += '</span> _TAGS'; |
|
67 revlink += '<span class="info">_DATE, by _USER</span></li>'; |
|
68 |
|
69 graph.vertex = function(x, y, color, parity, cur) \{ |
|
70 |
|
71 this.ctx.beginPath(); |
|
72 color = this.setColor(color, 0.25, 0.75); |
|
73 this.ctx.arc(x, y, radius, 0, Math.PI * 2, true); |
|
74 this.ctx.fill(); |
|
75 |
|
76 var bg = '<li class="bg parity' + parity + '"></li>'; |
|
77 var left = (this.columns + 1) * this.bg_height; |
|
78 var nstyle = 'padding-left: ' + left + 'px;'; |
|
79 var item = revlink.replace(/_STYLE/, nstyle); |
|
80 item = item.replace(/_PARITY/, 'parity' + parity); |
|
81 item = item.replace(/_NODEID/, cur[0]); |
|
82 item = item.replace(/_NODEID/, cur[0]); |
|
83 item = item.replace(/_DESC/, cur[3]); |
|
84 item = item.replace(/_USER/, cur[4]); |
|
85 item = item.replace(/_DATE/, cur[5]); |
|
86 |
|
87 var tagspan = ''; |
|
88 if (cur[7].length || (cur[6][0] != 'default' || cur[6][1])) \{ |
|
89 tagspan = '<span class="logtags">'; |
|
90 if (cur[6][1]) \{ |
|
91 tagspan += '<span class="branchtag" title="' + cur[6][0] + '">'; |
|
92 tagspan += cur[6][0] + '</span> '; |
|
93 } else if (!cur[6][1] && cur[6][0] != 'default') \{ |
|
94 tagspan += '<span class="inbranchtag" title="' + cur[6][0] + '">'; |
|
95 tagspan += cur[6][0] + '</span> '; |
|
96 } |
|
97 if (cur[7].length) \{ |
|
98 for (var t in cur[7]) \{ |
|
99 var tag = cur[7][t]; |
|
100 tagspan += '<span class="tagtag">' + tag + '</span> '; |
|
101 } |
|
102 } |
|
103 tagspan += '</span>'; |
|
104 } |
|
105 |
|
106 item = item.replace(/_TAGS/, tagspan); |
|
107 return [bg, item]; |
|
108 |
|
109 } |
|
110 |
|
111 graph.render(data); |
|
112 |
|
113 // stop hiding script --> |
|
114 </script> |
|
115 |
|
116 <div class="page_nav"> |
|
117 <a href="{url}graph/{rev}{lessvars%urlparameter}">less</a> |
|
118 <a href="{url}graph/{rev}{morevars%urlparameter}">more</a> |
|
119 | {changenav%navgraph} |
|
120 </div> |
|
121 |
|
122 {footer} |