[PATCH 4 of 4 V5] hgweb: add links to diff and changeset views from annotate view table
Denis Laxalde
denis.laxalde at logilab.fr
Tue Jun 14 08:53:15 EDT 2016
# HG changeset patch
# User Denis Laxalde <denis.laxalde at logilab.fr>
# Date 1465894890 -7200
# Tue Jun 14 11:01:30 2016 +0200
# Node ID 961683779514a299fd884bf92eb043c5446340a4
# Parent ad269193c2590946f31d7f86fbd85f06f6baacb4
hgweb: add links to diff and changeset views from annotate view table
Links appear upon hover of the annotated revision, above the links to parents.
diff --git a/mercurial/templates/gitweb/map b/mercurial/templates/gitweb/map
--- a/mercurial/templates/gitweb/map
+++ b/mercurial/templates/gitweb/map
@@ -101,6 +101,10 @@ annotateline = '
'<a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}#l{targetline}"
title="{node|short}: {desc|escape|firstline}">{author|user}@{rev}</a>
<div class="annotate-info">
+ <a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}"
+ title="diff {file|urlescape}@{node|short}">diff</a>
+ <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}"
+ title="{node|short}: {desc|escape|firstline}">rev</a>
{parents%annotateparent}
</div>',
'')}
diff --git a/mercurial/templates/monoblue/map b/mercurial/templates/monoblue/map
--- a/mercurial/templates/monoblue/map
+++ b/mercurial/templates/monoblue/map
@@ -97,6 +97,10 @@ annotateline = '
'<a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}#l{targetline}"
title="{node|short}: {desc|escape|firstline}">{author|user}@{rev}</a>
<div class="annotate-info">
+ <a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}"
+ title="diff {file|urlescape}@{node|short}">diff</a>
+ <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}"
+ title="{node|short}: {desc|escape|firstline}">rev</a>
{parents%annotateparent}
</div>',
'')}
diff --git a/mercurial/templates/paper/map b/mercurial/templates/paper/map
--- a/mercurial/templates/paper/map
+++ b/mercurial/templates/paper/map
@@ -82,6 +82,10 @@ annotateline = '
'<a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}#l{targetline}"
title="{node|short}: {desc|escape|firstline}">{author|user}@{rev}</a>
<div class="annotate-info">
+ <a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}"
+ title="diff {file|urlescape}@{node|short}">diff</a>
+ <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}"
+ title="{node|short}: {desc|escape|firstline}">rev</a>
{parents%annotateparent}
</div>',
'')}
diff --git a/mercurial/templates/spartan/map b/mercurial/templates/spartan/map
--- a/mercurial/templates/spartan/map
+++ b/mercurial/templates/spartan/map
@@ -60,6 +60,10 @@ annotateline = '
'<a href="{url|urlescape}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}#l{targetline}"
title="{node|short}: {desc|escape|firstline}">{author|user}@{rev}</a>
<div class="annotate-info">
+ <a href="{url|urlescape}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}"
+ title="diff {file|urlescape}@{node|short}">diff</a>
+ <a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}"
+ title="{node|short}: {desc|escape|firstline}">rev</a>
{parents%annotateparent}
</div>',
'')}
diff --git a/tests/test-hgweb-symrev.t b/tests/test-hgweb-symrev.t
--- a/tests/test-hgweb-symrev.t
+++ b/tests/test-hgweb-symrev.t
@@ -191,7 +191,11 @@ Set up the repo
<td class="author"><a href="/file/43c799df6e75/foo?style=paper">43c799df6e75</a> </td>
<td class="author"><a href="/file/9d8c40cba617/foo?style=paper">9d8c40cba617</a> </td>
<a href="/annotate/43c799df6e75/foo?style=paper#l1"
+ <a href="/diff/43c799df6e75/foo?style=paper"
+ <a href="/rev/43c799df6e75?style=paper"
<a href="/annotate/a7c1559b7bba/foo?style=paper#l2"
+ <a href="/diff/a7c1559b7bba/foo?style=paper"
+ <a href="/rev/a7c1559b7bba?style=paper"
<p>parent: <a href="/annotate/43c799df6e75/foo?style=paper"
$ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'diff/xyzzy/foo?style=paper' | egrep $REVLINKS
@@ -380,7 +384,11 @@ Set up the repo
<td class="author"><a href="/file/43c799df6e75/foo?style=coal">43c799df6e75</a> </td>
<td class="author"><a href="/file/9d8c40cba617/foo?style=coal">9d8c40cba617</a> </td>
<a href="/annotate/43c799df6e75/foo?style=coal#l1"
+ <a href="/diff/43c799df6e75/foo?style=coal"
+ <a href="/rev/43c799df6e75?style=coal"
<a href="/annotate/a7c1559b7bba/foo?style=coal#l2"
+ <a href="/diff/a7c1559b7bba/foo?style=coal"
+ <a href="/rev/a7c1559b7bba?style=coal"
<p>parent: <a href="/annotate/43c799df6e75/foo?style=coal"
$ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'diff/xyzzy/foo?style=coal' | egrep $REVLINKS
@@ -619,7 +627,11 @@ Set up the repo
<a class="list" href="/annotate/43c799df6e75/foo?style=gitweb">
<a class="list" href="/annotate/9d8c40cba617/foo?style=gitweb">9d8c40cba617</a></td>
<a href="/annotate/43c799df6e75/foo?style=gitweb#l1"
+ <a href="/diff/43c799df6e75/foo?style=gitweb"
+ <a href="/rev/43c799df6e75?style=gitweb"
<a href="/annotate/a7c1559b7bba/foo?style=gitweb#l2"
+ <a href="/diff/a7c1559b7bba/foo?style=gitweb"
+ <a href="/rev/a7c1559b7bba?style=gitweb"
<p>parent: <a href="/annotate/43c799df6e75/foo?style=gitweb"
$ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'diff/xyzzy/foo?style=gitweb' | egrep $REVLINKS
@@ -836,7 +848,11 @@ Set up the repo
<a href="/annotate/43c799df6e75/foo?style=monoblue">
<a href="/annotate/9d8c40cba617/foo?style=monoblue">9d8c40cba617</a>
<a href="/annotate/43c799df6e75/foo?style=monoblue#l1"
+ <a href="/diff/43c799df6e75/foo?style=monoblue"
+ <a href="/rev/43c799df6e75?style=monoblue"
<a href="/annotate/a7c1559b7bba/foo?style=monoblue#l2"
+ <a href="/diff/a7c1559b7bba/foo?style=monoblue"
+ <a href="/rev/a7c1559b7bba?style=monoblue"
<p>parent: <a href="/annotate/43c799df6e75/foo?style=monoblue"
$ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'diff/xyzzy/foo?style=monoblue' | egrep $REVLINKS
@@ -1034,7 +1050,11 @@ Set up the repo
<a href="/annotate/43c799df6e75/foo?style=spartan">
<td><a href="/annotate/9d8c40cba617/foo?style=spartan">9d8c40cba617</a></td>
<a href="/annotate/43c799df6e75/foo?style=spartan#l1"
+ <a href="/diff/43c799df6e75/foo?style=spartan"
+ <a href="/rev/43c799df6e75?style=spartan"
<a href="/annotate/a7c1559b7bba/foo?style=spartan#l2"
+ <a href="/diff/a7c1559b7bba/foo?style=spartan"
+ <a href="/rev/a7c1559b7bba?style=spartan"
<p>parent: <a href="/annotate/43c799df6e75/foo?style=spartan"
$ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'diff/xyzzy/foo?style=spartan' | egrep $REVLINKS
diff --git a/tests/test-highlight.t b/tests/test-highlight.t
--- a/tests/test-highlight.t
+++ b/tests/test-highlight.t
@@ -293,6 +293,10 @@ hgweb fileannotate, html
<a href="/annotate/06824edf55d0/primes.py#l1"
title="06824edf55d0: a">test at 0</a>
<div class="annotate-info">
+ <a href="/diff/06824edf55d0/primes.py"
+ title="diff primes.py at 06824edf55d0">diff</a>
+ <a href="/rev/06824edf55d0"
+ title="06824edf55d0: a">rev</a>
</div>
</td>
More information about the Mercurial-devel
mailing list