annotate mercurial-tests/testData/bin/templates/spartan/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-tags" title="Atom feed for {repo|escape}: tags">
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-tags" title="RSS feed for {repo|escape}: tags">
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="buttons">
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
12 <a href="{url}log{sessionvars%urlparameter}">changelog</a>
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
13 <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
14 <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
15 <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
16 <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
17 </div>
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
18
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
19 <h2>graph</h2>
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
20
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
21 <form action="{url}log">
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
22 {sessionvars%hiddenformentry}
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
23 <p>
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
24 <label for="search1">search:</label>
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
25 <input name="rev" id="search1" type="text" size="30">
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
26 navigate: <small class="navigate">{changenav%navgraph}</small>
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
27 </p>
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
28 </form>
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
29
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
30 <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
31
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
32 <div id="wrapper">
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
33 <ul id="nodebgs"></ul>
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
34 <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
35 <ul id="graphnodes"></ul>
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
36 </div>
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
37
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
38 <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
39 <script type="text/javascript">
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
40 <!-- hide script content
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
41
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
42 var data = {jsdata|json};
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
43 var graph = new Graph();
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
44 graph.scale({bg_height});
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
45
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
46 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
47
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
48 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
49 this.ctx.beginPath();
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
50 this.ctx.moveTo(x0, y0);
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
51 this.ctx.lineTo(x1, y1);
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
52 this.ctx.stroke();
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
53
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
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
56 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
57 revlink += '<a href="{url}rev/_NODEID{sessionvars%urlparameter}" title="_NODEID">_DESC</a>';
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
58 revlink += '</span><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
59
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
60 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
61
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
62 this.ctx.beginPath();
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
63 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
64 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
65 this.ctx.fill();
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
66
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
67 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
68 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
69 var nstyle = 'padding-left: ' + left + 'px;';
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
70 var item = revlink.replace(/_STYLE/, nstyle);
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
71 item = item.replace(/_PARITY/, 'parity' + parity);
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
72 item = item.replace(/_NODEID/, cur[0]);
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
73 item = item.replace(/_NODEID/, cur[0]);
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
74 item = item.replace(/_DESC/, cur[3]);
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
75 item = item.replace(/_USER/, cur[4]);
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
76 item = item.replace(/_DATE/, cur[5]);
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
77
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
78 return [bg, item];
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
79
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
80 }
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
81
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
82 graph.render(data);
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
83
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
84 // stop hiding script -->
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
85 </script>
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
86
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
87 <form action="{url}log">
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
88 {sessionvars%hiddenformentry}
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
89 <p>
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
90 <label for="search1">search:</label>
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
91 <input name="rev" id="search1" type="text" size="30">
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
92 navigate: <small class="navigate">{changenav%navgraph}</small>
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
93 </p>
2e52f00a3c94 Update whole hg distribution to 1.5.2
Dmitry Neverov <dmitry.neverov@jetbrains.com>
parents:
diff changeset
94 </form>
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 {footer}