# HG changeset patch # User Steven Brown # Date 1307798690 -28800 # Node ID 17c0cb1045e549d9bbbd9ba25dee18f7df4a11a3 # Parent 9f908ef5a595ff3be835a14cc0f4f4df51645268 paper, coal: display diffstat on the changeset page Displayed in a row of the changeset summary table, underneath the list of files. When the page is loaded, only the diff summary is displayed. The full diffstat is only displayed when the [+] link is selected. diff -r 9f908ef5a595 -r 17c0cb1045e5 mercurial/templates/paper/changeset.tmpl --- a/mercurial/templates/paper/changeset.tmpl Sat Jun 11 21:11:43 2011 +0800 +++ b/mercurial/templates/paper/changeset.tmpl Sat Jun 11 21:24:50 2011 +0800 @@ -62,6 +62,18 @@ files {files} + + diffstat + + {diffsummary} + [+] + + +
diff -r 9f908ef5a595 -r 17c0cb1045e5 mercurial/templates/static/mercurial.js --- a/mercurial/templates/static/mercurial.js Sat Jun 11 21:11:43 2011 +0800 +++ b/mercurial/templates/static/mercurial.js Sat Jun 11 21:24:50 2011 +0800 @@ -2,6 +2,7 @@ // // Rendering of branch DAGs on the client side // Display of elapsed time +// Show or hide diffstat // // Copyright 2008 Dirkjan Ochtman // Copyright 2006 Alexander Schremmer @@ -218,3 +219,13 @@ } } })(document, RegExp, Math, isNaN, Date, false, true) + +function showDiffstat() { + document.getElementById('diffstatdetails').style.display = 'inline'; + document.getElementById('diffstatexpand').style.display = 'none'; +} + +function hideDiffstat() { + document.getElementById('diffstatdetails').style.display = 'none'; + document.getElementById('diffstatexpand').style.display = 'inline'; +} diff -r 9f908ef5a595 -r 17c0cb1045e5 tests/test-hgweb-commands.t --- a/tests/test-hgweb-commands.t Sat Jun 11 21:11:43 2011 +0800 +++ b/tests/test-hgweb-commands.t Sat Jun 11 21:24:50 2011 +0800 @@ -352,6 +352,35 @@ files da/foo foo + + diffstat + + 2 files changed, 2 insertions(+), 0 deletions(-) + + [+] + + +
diff -r 9f908ef5a595 -r 17c0cb1045e5 tests/test-hgweb-diffs.t --- a/tests/test-hgweb-diffs.t Sat Jun 11 21:11:43 2011 +0800 +++ b/tests/test-hgweb-diffs.t Sat Jun 11 21:24:50 2011 +0800 @@ -94,6 +94,35 @@ files a b + + diffstat + + 2 files changed, 2 insertions(+), 0 deletions(-) + + [+] + + +
@@ -325,6 +354,35 @@ files a b + + diffstat + + 2 files changed, 2 insertions(+), 0 deletions(-) + + [+] + + +
diff -r 9f908ef5a595 -r 17c0cb1045e5 tests/test-hgweb-removed.t --- a/tests/test-hgweb-removed.t Sat Jun 11 21:11:43 2011 +0800 +++ b/tests/test-hgweb-removed.t Sat Jun 11 21:24:50 2011 +0800 @@ -89,6 +89,27 @@ files a + + diffstat + + 1 files changed, 0 insertions(+), 1 deletions(-) + + [+] + + +