mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 08:18:15 +03:00
gitweb: render changesets server-side on /graph page
This commit is contained in:
parent
3c2de0ad20
commit
55006fdcc2
@ -85,6 +85,7 @@
|
|||||||
<File Id="gitweb.filerevision.tmpl" Name="filerevision.tmpl" />
|
<File Id="gitweb.filerevision.tmpl" Name="filerevision.tmpl" />
|
||||||
<File Id="gitweb.footer.tmpl" Name="footer.tmpl" />
|
<File Id="gitweb.footer.tmpl" Name="footer.tmpl" />
|
||||||
<File Id="gitweb.graph.tmpl" Name="graph.tmpl" />
|
<File Id="gitweb.graph.tmpl" Name="graph.tmpl" />
|
||||||
|
<File Id="gitweb.graphentry.tmpl" Name="graphentry.tmpl" />
|
||||||
<File Id="gitweb.header.tmpl" Name="header.tmpl" />
|
<File Id="gitweb.header.tmpl" Name="header.tmpl" />
|
||||||
<File Id="gitweb.index.tmpl" Name="index.tmpl" />
|
<File Id="gitweb.index.tmpl" Name="index.tmpl" />
|
||||||
<File Id="gitweb.manifest.tmpl" Name="manifest.tmpl" />
|
<File Id="gitweb.manifest.tmpl" Name="manifest.tmpl" />
|
||||||
|
@ -39,7 +39,7 @@ graph |
|
|||||||
<div id="wrapper">
|
<div id="wrapper">
|
||||||
<ul id="nodebgs"></ul>
|
<ul id="nodebgs"></ul>
|
||||||
<canvas id="graph" width="{canvaswidth}" height="{canvasheight}"></canvas>
|
<canvas id="graph" width="{canvaswidth}" height="{canvasheight}"></canvas>
|
||||||
<ul id="graphnodes"></ul>
|
<ul id="graphnodes">{nodes%graphentry}</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script{if(nonce, ' nonce="{nonce}"')}>
|
<script{if(nonce, ' nonce="{nonce}"')}>
|
||||||
@ -58,39 +58,13 @@ graph.vertex = function(x, y, radius, color, parity, cur) \{
|
|||||||
|
|
||||||
var bg = '<li class="bg parity' + parity + '"></li>';
|
var bg = '<li class="bg parity' + parity + '"></li>';
|
||||||
var left = (this.bg_height - this.box_size) + (this.columns + 1) * this.box_size;
|
var left = (this.bg_height - this.box_size) + (this.columns + 1) * this.box_size;
|
||||||
var nstyle = 'padding-left: ' + left + 'px;';
|
|
||||||
|
|
||||||
var tagspan = '';
|
var item = document.querySelector('[data-node="' + cur.node + '"]');
|
||||||
if (cur[7].length || cur[8].length || (cur[6][0] != 'default' || cur[6][1])) \{
|
if (item) \{
|
||||||
tagspan = '<span class="logtags">';
|
item.style.paddingLeft = left + 'px';
|
||||||
if (cur[6][1]) \{
|
|
||||||
tagspan += '<span class="branchtag" title="' + cur[6][0] + '">';
|
|
||||||
tagspan += cur[6][0] + '</span> ';
|
|
||||||
} else if (!cur[6][1] && cur[6][0] != 'default') \{
|
|
||||||
tagspan += '<span class="inbranchtag" title="' + cur[6][0] + '">';
|
|
||||||
tagspan += cur[6][0] + '</span> ';
|
|
||||||
}
|
|
||||||
if (cur[7].length) \{
|
|
||||||
for (var t in cur[7]) \{
|
|
||||||
var tag = cur[7][t];
|
|
||||||
tagspan += '<span class="tagtag">' + tag + '</span> ';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (cur[8].length) \{
|
|
||||||
for (var t in cur[8]) \{
|
|
||||||
var bookmark = cur[8][t];
|
|
||||||
tagspan += '<span class="bookmarktag">' + bookmark + '</span> ';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
tagspan += '</span>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var item = '<li style="' + nstyle + '"><span class="desc">';
|
return [bg, ''];
|
||||||
item += '<a class="list" href="{url|urlescape}rev/' + cur[0] + '{sessionvars%urlparameter}" title="' + cur[0] + '"><b>' + cur[3] + '</b></a>';
|
|
||||||
item += '</span> ' + tagspan + '';
|
|
||||||
item += '<span class="info">' + cur[5] + ', by ' + cur[4] + '</span></li>';
|
|
||||||
|
|
||||||
return [bg, item];
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
7
mercurial/templates/gitweb/graphentry.tmpl
Normal file
7
mercurial/templates/gitweb/graphentry.tmpl
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<li data-node="{node|short}">
|
||||||
|
<span class="desc">
|
||||||
|
<a class="list" href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}"><b>{desc|strip|firstline|escape|nonempty}</b></a>
|
||||||
|
</span>
|
||||||
|
{alltags}
|
||||||
|
<span class="info">{date|age}, by {author|person}</span>
|
||||||
|
</li>
|
@ -262,6 +262,7 @@ filecompchild = '
|
|||||||
</tr>'
|
</tr>'
|
||||||
shortlog = shortlog.tmpl
|
shortlog = shortlog.tmpl
|
||||||
graph = graph.tmpl
|
graph = graph.tmpl
|
||||||
|
graphentry = graphentry.tmpl
|
||||||
phasetag = '{ifeq(phase, 'public', '', '<span class="phasetag" title="{phase|escape}">{phase|escape}</span> ')}'
|
phasetag = '{ifeq(phase, 'public', '', '<span class="phasetag" title="{phase|escape}">{phase|escape}</span> ')}'
|
||||||
obsoletetag = '{if(obsolete, '<span class="obsoletetag" title="obsolete">obsolete</span> ')}'
|
obsoletetag = '{if(obsolete, '<span class="obsoletetag" title="obsolete">obsolete</span> ')}'
|
||||||
instabilitytag = '<span class="instabilitytag" title="{instability|escape}">{instability|escape}</span> '
|
instabilitytag = '<span class="instabilitytag" title="{instability|escape}">{instability|escape}</span> '
|
||||||
|
@ -1782,7 +1782,35 @@ Overviews
|
|||||||
<div id="wrapper">
|
<div id="wrapper">
|
||||||
<ul id="nodebgs"></ul>
|
<ul id="nodebgs"></ul>
|
||||||
<canvas id="graph" width="39" height="168"></canvas>
|
<canvas id="graph" width="39" height="168"></canvas>
|
||||||
<ul id="graphnodes"></ul>
|
<ul id="graphnodes"><li data-node="cad8025a2e87">
|
||||||
|
<span class="desc">
|
||||||
|
<a class="list" href="/rev/cad8025a2e87?style=gitweb"><b>branch commit with null character: </b></a>
|
||||||
|
</span>
|
||||||
|
<span class="logtags"><span class="phasetag" title="draft">draft</span> <span class="branchtag" title="unstable">unstable</span> <span class="tagtag" title="tip">tip</span> <span class="bookmarktag" title="something">something</span> </span>
|
||||||
|
<span class="info">1970-01-01, by test</span>
|
||||||
|
</li>
|
||||||
|
<li data-node="1d22e65f027e">
|
||||||
|
<span class="desc">
|
||||||
|
<a class="list" href="/rev/1d22e65f027e?style=gitweb"><b>branch</b></a>
|
||||||
|
</span>
|
||||||
|
<span class="logtags"><span class="phasetag" title="draft">draft</span> <span class="branchtag" title="stable">stable</span> </span>
|
||||||
|
<span class="info">1970-01-01, by test</span>
|
||||||
|
</li>
|
||||||
|
<li data-node="a4f92ed23982">
|
||||||
|
<span class="desc">
|
||||||
|
<a class="list" href="/rev/a4f92ed23982?style=gitweb"><b>Added tag 1.0 for changeset 2ef0ac749a14</b></a>
|
||||||
|
</span>
|
||||||
|
<span class="logtags"><span class="phasetag" title="draft">draft</span> <span class="branchtag" title="default">default</span> </span>
|
||||||
|
<span class="info">1970-01-01, by test</span>
|
||||||
|
</li>
|
||||||
|
<li data-node="2ef0ac749a14">
|
||||||
|
<span class="desc">
|
||||||
|
<a class="list" href="/rev/2ef0ac749a14?style=gitweb"><b>base</b></a>
|
||||||
|
</span>
|
||||||
|
<span class="logtags"><span class="phasetag" title="draft">draft</span> <span class="tagtag" title="1.0">1.0</span> <span class="bookmarktag" title="anotherthing">anotherthing</span> </span>
|
||||||
|
<span class="info">1970-01-01, by test</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -1801,39 +1829,13 @@ Overviews
|
|||||||
|
|
||||||
var bg = '<li class="bg parity' + parity + '"></li>';
|
var bg = '<li class="bg parity' + parity + '"></li>';
|
||||||
var left = (this.bg_height - this.box_size) + (this.columns + 1) * this.box_size;
|
var left = (this.bg_height - this.box_size) + (this.columns + 1) * this.box_size;
|
||||||
var nstyle = 'padding-left: ' + left + 'px;';
|
|
||||||
|
|
||||||
var tagspan = '';
|
var item = document.querySelector('[data-node="' + cur.node + '"]');
|
||||||
if (cur[7].length || cur[8].length || (cur[6][0] != 'default' || cur[6][1])) {
|
if (item) {
|
||||||
tagspan = '<span class="logtags">';
|
item.style.paddingLeft = left + 'px';
|
||||||
if (cur[6][1]) {
|
|
||||||
tagspan += '<span class="branchtag" title="' + cur[6][0] + '">';
|
|
||||||
tagspan += cur[6][0] + '</span> ';
|
|
||||||
} else if (!cur[6][1] && cur[6][0] != 'default') {
|
|
||||||
tagspan += '<span class="inbranchtag" title="' + cur[6][0] + '">';
|
|
||||||
tagspan += cur[6][0] + '</span> ';
|
|
||||||
}
|
|
||||||
if (cur[7].length) {
|
|
||||||
for (var t in cur[7]) {
|
|
||||||
var tag = cur[7][t];
|
|
||||||
tagspan += '<span class="tagtag">' + tag + '</span> ';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (cur[8].length) {
|
|
||||||
for (var t in cur[8]) {
|
|
||||||
var bookmark = cur[8][t];
|
|
||||||
tagspan += '<span class="bookmarktag">' + bookmark + '</span> ';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
tagspan += '</span>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var item = '<li style="' + nstyle + '"><span class="desc">';
|
return [bg, ''];
|
||||||
item += '<a class="list" href="/rev/' + cur[0] + '?style=gitweb" title="' + cur[0] + '"><b>' + cur[3] + '</b></a>';
|
|
||||||
item += '</span> ' + tagspan + '';
|
|
||||||
item += '<span class="info">' + cur[5] + ', by ' + cur[4] + '</span></li>';
|
|
||||||
|
|
||||||
return [bg, item];
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -493,6 +493,9 @@ Set up the repo
|
|||||||
<a href="/graph/tip?revcount=30&style=gitweb">less</a>
|
<a href="/graph/tip?revcount=30&style=gitweb">less</a>
|
||||||
<a href="/graph/tip?revcount=120&style=gitweb">more</a>
|
<a href="/graph/tip?revcount=120&style=gitweb">more</a>
|
||||||
| <a href="/graph/43c799df6e75?style=gitweb">(0)</a> <a href="/graph/tip?style=gitweb">tip</a>
|
| <a href="/graph/43c799df6e75?style=gitweb">(0)</a> <a href="/graph/tip?style=gitweb">tip</a>
|
||||||
|
<a class="list" href="/rev/9d8c40cba617?style=gitweb"><b>third</b></a>
|
||||||
|
<a class="list" href="/rev/a7c1559b7bba?style=gitweb"><b>second</b></a>
|
||||||
|
<a class="list" href="/rev/43c799df6e75?style=gitweb"><b>first</b></a>
|
||||||
<a href="/graph/tip?revcount=30&style=gitweb">less</a>
|
<a href="/graph/tip?revcount=30&style=gitweb">less</a>
|
||||||
<a href="/graph/tip?revcount=120&style=gitweb">more</a>
|
<a href="/graph/tip?revcount=120&style=gitweb">more</a>
|
||||||
| <a href="/graph/43c799df6e75?style=gitweb">(0)</a> <a href="/graph/tip?style=gitweb">tip</a>
|
| <a href="/graph/43c799df6e75?style=gitweb">(0)</a> <a href="/graph/tip?style=gitweb">tip</a>
|
||||||
@ -583,6 +586,8 @@ Set up the repo
|
|||||||
<a href="/graph/xyzzy?revcount=30&style=gitweb">less</a>
|
<a href="/graph/xyzzy?revcount=30&style=gitweb">less</a>
|
||||||
<a href="/graph/xyzzy?revcount=120&style=gitweb">more</a>
|
<a href="/graph/xyzzy?revcount=120&style=gitweb">more</a>
|
||||||
| <a href="/graph/43c799df6e75?style=gitweb">(0)</a> <a href="/graph/tip?style=gitweb">tip</a>
|
| <a href="/graph/43c799df6e75?style=gitweb">(0)</a> <a href="/graph/tip?style=gitweb">tip</a>
|
||||||
|
<a class="list" href="/rev/a7c1559b7bba?style=gitweb"><b>second</b></a>
|
||||||
|
<a class="list" href="/rev/43c799df6e75?style=gitweb"><b>first</b></a>
|
||||||
<a href="/graph/xyzzy?revcount=30&style=gitweb">less</a>
|
<a href="/graph/xyzzy?revcount=30&style=gitweb">less</a>
|
||||||
<a href="/graph/xyzzy?revcount=120&style=gitweb">more</a>
|
<a href="/graph/xyzzy?revcount=120&style=gitweb">more</a>
|
||||||
| <a href="/graph/43c799df6e75?style=gitweb">(0)</a> <a href="/graph/tip?style=gitweb">tip</a>
|
| <a href="/graph/43c799df6e75?style=gitweb">(0)</a> <a href="/graph/tip?style=gitweb">tip</a>
|
||||||
|
Loading…
Reference in New Issue
Block a user