coal/paper: Wrap diff in <pre/>
In text-mode browsers the diff is otherwise rendered
as just one long line per file. Other styles do the same.
--- a/templates/coal/map Tue May 12 01:08:28 2009 +0200
+++ b/templates/coal/map Wed May 13 16:31:19 2009 +0200
@@ -35,7 +35,7 @@
annotateline = '<tr class="parity{parity}"><td class="annotate"><a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}#{targetline}" title="{node|short}: {desc|escape|firstline}">{author|user}@{rev}</a></td><td class="source"><a href="#{lineid}" id="{lineid}">{linenumber}</a> {line|escape}</td></tr>'
-diffblock = '<div class="source bottomline parity{parity}">{lines}</div>'
+diffblock = '<div class="source bottomline parity{parity}"><pre>{lines}</pre></div>'
difflineplus = '<a href="#{lineid}" id="{lineid}">{linenumber}</a> <span class="plusline">{line|escape}</span>'
difflineminus = '<a href="#{lineid}" id="{lineid}">{linenumber}</a> <span class="minusline">{line|escape}</span>'
difflineat = '<a href="#{lineid}" id="{lineid}">{linenumber}</a> <span class="atline">{line|escape}</span>'
--- a/templates/paper/map Tue May 12 01:08:28 2009 +0200
+++ b/templates/paper/map Wed May 13 16:31:19 2009 +0200
@@ -35,7 +35,7 @@
annotateline = '<tr class="parity{parity}"><td class="annotate"><a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}#{targetline}" title="{node|short}: {desc|escape|firstline}">{author|user}@{rev}</a></td><td class="source"><a href="#{lineid}" id="{lineid}">{linenumber}</a> {line|escape}</td></tr>'
-diffblock = '<div class="source bottomline parity{parity}">{lines}</div>'
+diffblock = '<div class="source bottomline parity{parity}"><pre>{lines}</pre></div>'
difflineplus = '<a href="#{lineid}" id="{lineid}">{linenumber}</a> <span class="plusline">{line|escape}</span>'
difflineminus = '<a href="#{lineid}" id="{lineid}">{linenumber}</a> <span class="minusline">{line|escape}</span>'
difflineat = '<a href="#{lineid}" id="{lineid}">{linenumber}</a> <span class="atline">{line|escape}</span>'
Binary file tests/test-hgweb-commands.out has changed
--- a/tests/test-hgweb-diffs.out Tue May 12 01:08:28 2009 +0200
+++ b/tests/test-hgweb-diffs.out Wed May 13 16:31:19 2009 +0200
@@ -77,15 +77,15 @@
<div class="overflow">
<div class="sourcefirst"> line diff</div>
-<div class="source bottomline parity0"><a href="#l1.1" id="l1.1"> 1.1</a> <span class="minusline">--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+<div class="source bottomline parity0"><pre><a href="#l1.1" id="l1.1"> 1.1</a> <span class="minusline">--- /dev/null Thu Jan 01 00:00:00 1970 +0000
</span><a href="#l1.2" id="l1.2"> 1.2</a> <span class="plusline">+++ b/a Thu Jan 01 00:00:00 1970 +0000
</span><a href="#l1.3" id="l1.3"> 1.3</a> <span class="atline">@@ -0,0 +1,1 @@
</span><a href="#l1.4" id="l1.4"> 1.4</a> <span class="plusline">+a
-</span></div><div class="source bottomline parity1"><a href="#l2.1" id="l2.1"> 2.1</a> <span class="minusline">--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+</span></pre></div><div class="source bottomline parity1"><pre><a href="#l2.1" id="l2.1"> 2.1</a> <span class="minusline">--- /dev/null Thu Jan 01 00:00:00 1970 +0000
</span><a href="#l2.2" id="l2.2"> 2.2</a> <span class="plusline">+++ b/b Thu Jan 01 00:00:00 1970 +0000
</span><a href="#l2.3" id="l2.3"> 2.3</a> <span class="atline">@@ -0,0 +1,1 @@
</span><a href="#l2.4" id="l2.4"> 2.4</a> <span class="plusline">+b
-</span></div>
+</span></pre></div>
</div>
</div>
@@ -170,11 +170,11 @@
<div class="overflow">
<div class="sourcefirst"> line diff</div>
-<div class="source bottomline parity0"><a href="#l1.1" id="l1.1"> 1.1</a> <span class="minusline">--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+<div class="source bottomline parity0"><pre><a href="#l1.1" id="l1.1"> 1.1</a> <span class="minusline">--- /dev/null Thu Jan 01 00:00:00 1970 +0000
</span><a href="#l1.2" id="l1.2"> 1.2</a> <span class="plusline">+++ b/a Thu Jan 01 00:00:00 1970 +0000
</span><a href="#l1.3" id="l1.3"> 1.3</a> <span class="atline">@@ -0,0 +1,1 @@
</span><a href="#l1.4" id="l1.4"> 1.4</a> <span class="plusline">+a
-</span></div>
+</span></pre></div>
</div>
</div>
</div>
@@ -259,17 +259,17 @@
<div class="overflow">
<div class="sourcefirst"> line diff</div>
-<div class="source bottomline parity0"><a href="#l1.1" id="l1.1"> 1.1</a> new file mode 100644
+<div class="source bottomline parity0"><pre><a href="#l1.1" id="l1.1"> 1.1</a> new file mode 100644
<a href="#l1.2" id="l1.2"> 1.2</a> <span class="minusline">--- /dev/null
</span><a href="#l1.3" id="l1.3"> 1.3</a> <span class="plusline">+++ b/a
</span><a href="#l1.4" id="l1.4"> 1.4</a> <span class="atline">@@ -0,0 +1,1 @@
</span><a href="#l1.5" id="l1.5"> 1.5</a> <span class="plusline">+a
-</span></div><div class="source bottomline parity1"><a href="#l2.1" id="l2.1"> 2.1</a> new file mode 100644
+</span></pre></div><div class="source bottomline parity1"><pre><a href="#l2.1" id="l2.1"> 2.1</a> new file mode 100644
<a href="#l2.2" id="l2.2"> 2.2</a> <span class="minusline">--- /dev/null
</span><a href="#l2.3" id="l2.3"> 2.3</a> <span class="plusline">+++ b/b
</span><a href="#l2.4" id="l2.4"> 2.4</a> <span class="atline">@@ -0,0 +1,1 @@
</span><a href="#l2.5" id="l2.5"> 2.5</a> <span class="plusline">+b
-</span></div>
+</span></pre></div>
</div>
</div>
@@ -354,12 +354,12 @@
<div class="overflow">
<div class="sourcefirst"> line diff</div>
-<div class="source bottomline parity0"><a href="#l1.1" id="l1.1"> 1.1</a> new file mode 100755
+<div class="source bottomline parity0"><pre><a href="#l1.1" id="l1.1"> 1.1</a> new file mode 100755
<a href="#l1.2" id="l1.2"> 1.2</a> <span class="minusline">--- /dev/null
</span><a href="#l1.3" id="l1.3"> 1.3</a> <span class="plusline">+++ b/a
</span><a href="#l1.4" id="l1.4"> 1.4</a> <span class="atline">@@ -0,0 +1,1 @@
</span><a href="#l1.5" id="l1.5"> 1.5</a> <span class="plusline">+a
-</span></div>
+</span></pre></div>
</div>
</div>
</div>
--- a/tests/test-hgweb-removed.out Tue May 12 01:08:28 2009 +0200
+++ b/tests/test-hgweb-removed.out Wed May 13 16:31:19 2009 +0200
@@ -75,11 +75,11 @@
<div class="overflow">
<div class="sourcefirst"> line diff</div>
-<div class="source bottomline parity0"><a href="#l1.1" id="l1.1"> 1.1</a> <span class="minusline">--- a/a Thu Jan 01 00:00:00 1970 +0000
+<div class="source bottomline parity0"><pre><a href="#l1.1" id="l1.1"> 1.1</a> <span class="minusline">--- a/a Thu Jan 01 00:00:00 1970 +0000
</span><a href="#l1.2" id="l1.2"> 1.2</a> <span class="plusline">+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
</span><a href="#l1.3" id="l1.3"> 1.3</a> <span class="atline">@@ -1,1 +0,0 @@
</span><a href="#l1.4" id="l1.4"> 1.4</a> <span class="minusline">-a
-</span></div>
+</span></pre></div>
</div>
</div>
@@ -164,11 +164,11 @@
<div class="overflow">
<div class="sourcefirst"> line diff</div>
-<div class="source bottomline parity0"><a href="#l1.1" id="l1.1"> 1.1</a> <span class="minusline">--- a/a Thu Jan 01 00:00:00 1970 +0000
+<div class="source bottomline parity0"><pre><a href="#l1.1" id="l1.1"> 1.1</a> <span class="minusline">--- a/a Thu Jan 01 00:00:00 1970 +0000
</span><a href="#l1.2" id="l1.2"> 1.2</a> <span class="plusline">+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
</span><a href="#l1.3" id="l1.3"> 1.3</a> <span class="atline">@@ -1,1 +0,0 @@
</span><a href="#l1.4" id="l1.4"> 1.4</a> <span class="minusline">-a
-</span></div>
+</span></pre></div>
</div>
</div>
</div>