# HG changeset patch # User Denis Laxalde # Date 1493022735 -7200 # Node ID a298f5c61b34237579205d9ece9855e998446ab6 # Parent a457da5296a5ad25c2b5cc22509c3340fd4e48f8 hgweb: do not show "descending" link in followlines UI for filelog heads When on a filelog head, we are certain that there will be no descendant so the target of the "descending" link will lead to an empty log result. Do not display the link in this case. diff -r a457da5296a5 -r a298f5c61b34 mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py Mon Apr 24 18:33:23 2017 +0200 +++ b/mercurial/hgweb/webcommands.py Mon Apr 24 10:32:15 2017 +0200 @@ -131,6 +131,7 @@ f = fctx.path() text = fctx.data() parity = paritygen(web.stripecount) + ishead = fctx.filerev() in fctx.filelog().headrevs() if util.binary(text): mt = mimetypes.guess_type(f)[0] or 'application/octet-stream' @@ -150,6 +151,7 @@ symrev=webutil.symrevorshortnode(req, fctx), rename=webutil.renamelink(fctx), permissions=fctx.manifest().flags(f), + ishead=int(ishead), **webutil.commonentry(web.repo, fctx)) @webcommand('file') diff -r a457da5296a5 -r a298f5c61b34 mercurial/templates/gitweb/filerevision.tmpl --- a/mercurial/templates/gitweb/filerevision.tmpl Mon Apr 24 18:33:23 2017 +0200 +++ b/mercurial/templates/gitweb/filerevision.tmpl Mon Apr 24 10:32:15 2017 +0200 @@ -64,7 +64,7 @@
-
{text%fileline}
+
{text%fileline}
diff -r a457da5296a5 -r a298f5c61b34 mercurial/templates/paper/filerevision.tmpl --- a/mercurial/templates/paper/filerevision.tmpl Mon Apr 24 18:33:23 2017 +0200 +++ b/mercurial/templates/paper/filerevision.tmpl Mon Apr 24 10:32:15 2017 +0200 @@ -71,7 +71,7 @@
line wrap: on
line source
-
{text%fileline}
+
{text%fileline}
diff -r a457da5296a5 -r a298f5c61b34 mercurial/templates/static/followlines.js --- a/mercurial/templates/static/followlines.js Mon Apr 24 18:33:23 2017 +0200 +++ b/mercurial/templates/static/followlines.js Mon Apr 24 10:32:15 2017 +0200 @@ -17,6 +17,8 @@ return; } + var isHead = parseInt(sourcelines.dataset.ishead || "0"); + // tooltip to invite on lines selection var tooltip = document.createElement('div'); tooltip.id = 'followlines-tooltip'; @@ -153,7 +155,7 @@ // append the
element to last line of the // selection block - var divAndButton = followlinesBox(targetUri, startId, endId); + var divAndButton = followlinesBox(targetUri, startId, endId, isHead); var div = divAndButton[0], button = divAndButton[1]; inviteElement.appendChild(div); @@ -186,7 +188,7 @@ sourcelines.addEventListener('click', lineSelectStart); //** return a
and inner cancel