annotate mercurial-tests/testData/bin/templates/gitweb/graph.tmpl @ 1063:4b6661db8a8a Lakhnau-2020.2.x

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