Patchwork [2,of,4,V3] hgweb: code selection without line numbers in file diff and changeset views

login
register
mail settings
Submitter Alexander Plavin
Date June 1, 2013, 6:09 p.m.
Message ID <52ac6e0376d90af868b8.1370110192@debian-alexander.dolgopa>
Download mbox | patch
Permalink /patch/1693/
State Changes Requested, archived
Headers show

Comments

Alexander Plavin - June 1, 2013, 6:09 p.m.
# HG changeset patch
# User Alexander Plavin <me@aplavin.ru>
# Date 1369931030 -14400
#      Thu May 30 20:23:50 2013 +0400
# Node ID 52ac6e0376d90af868b87d89d2a9e86228cba812
# Parent  39a32bcfb6581479afb5afc761e8ebcf5f41fbc2
hgweb: code selection without line numbers in file diff and changeset views

File diff and changeset views display lines the same way as file code view, as
HTML ordered list, so that line numbers are not selected with the code itself.

Patch

diff -r 39a32bcfb658 -r 52ac6e0376d9 mercurial/templates/paper/changeset.tmpl
--- a/mercurial/templates/paper/changeset.tmpl	Fri May 31 12:25:09 2013 +0400
+++ b/mercurial/templates/paper/changeset.tmpl	Thu May 30 20:23:50 2013 +0400
@@ -77,7 +77,7 @@ 
 </table>
 
 <div class="overflow">
-<div class="sourcefirst">   line diff</div>
+<div class="sourcefirst"></div>
 
 {diff}
 </div>
diff -r 39a32bcfb658 -r 52ac6e0376d9 mercurial/templates/paper/filediff.tmpl
--- a/mercurial/templates/paper/filediff.tmpl	Fri May 31 12:25:09 2013 +0400
+++ b/mercurial/templates/paper/filediff.tmpl	Thu May 30 20:23:50 2013 +0400
@@ -68,7 +68,7 @@ 
 </table>
 
 <div class="overflow">
-<div class="sourcefirst">   line diff</div>
+<div class="sourcefirst"></div>
 
 {diff}
 </div>
diff -r 39a32bcfb658 -r 52ac6e0376d9 mercurial/templates/paper/map
--- a/mercurial/templates/paper/map	Fri May 31 12:25:09 2013 +0400
+++ b/mercurial/templates/paper/map	Thu May 30 20:23:50 2013 +0400
@@ -84,11 +84,11 @@ 
     <td class="source"><a href="#{lineid}" id="{lineid}">{linenumber}</a> {line|escape}</td>
   </tr>'
 
-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>'
-diffline = '<a href="#{lineid}" id="{lineid}">{linenumber}</a> {line|escape}'
+diffblock = '<div class="bottomline"><ol class="parity{parity} sourcelines">{lines}</ol></div>'
+difflineplus = '<li class="source" id="{lineid}"><div class="plusline">{line|escape|spaceifempty}</div></li>'
+difflineminus = '<li class="source" id="{lineid}"><div class="minusline">{line|escape|spaceifempty}</div></li>'
+difflineat = '<li class="source" id="{lineid}"><div class="atline">{line|escape|spaceifempty}</div></li>'
+diffline = '<li class="source" id="{lineid}"><div>{line|escape|spaceifempty}</div></li>'
 
 comparisonblock ='
   <tbody class="block">
diff -r 39a32bcfb658 -r 52ac6e0376d9 mercurial/templates/static/style-paper.css
--- a/mercurial/templates/static/style-paper.css	Fri May 31 12:25:09 2013 +0400
+++ b/mercurial/templates/static/style-paper.css	Thu May 30 20:23:50 2013 +0400
@@ -96,9 +96,9 @@ 
 .indexlinks { white-space:nowrap; }
 .parity0 { background-color: #f0f0f0; }
 .parity1 { background-color: white; }
-.plusline { color: green; }
-.minusline { color: #dc143c; } /* crimson */
-.atline { color: purple; }
+.plusline { color: green !important; }
+.minusline { color: #dc143c !important; } /* crimson */
+.atline { color: purple !important; }
 
 .diffstat-file {
   white-space: nowrap;
diff -r 39a32bcfb658 -r 52ac6e0376d9 tests/test-hgweb-commands.t
--- a/tests/test-hgweb-commands.t	Fri May 31 12:25:09 2013 +0400
+++ b/tests/test-hgweb-commands.t	Thu May 30 20:23:50 2013 +0400
@@ -453,17 +453,17 @@ 
   </table>
   
   <div class="overflow">
-  <div class="sourcefirst">   line diff</div>
+  <div class="sourcefirst"></div>
   
-  <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/da/foo	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">+foo
-  </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/foo	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">+foo
-  </span></pre></div>
+  <div class="bottomline"><ol class="parity0 sourcelines"><li class="source" id="l1.1"><div class="minusline">--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  </div></li><li class="source" id="l1.2"><div class="plusline">+++ b/da/foo	Thu Jan 01 00:00:00 1970 +0000
+  </div></li><li class="source" id="l1.3"><div class="atline">@@ -0,0 +1,1 @@
+  </div></li><li class="source" id="l1.4"><div class="plusline">+foo
+  </div></li></ol></div><div class="bottomline"><ol class="parity1 sourcelines"><li class="source" id="l2.1"><div class="minusline">--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  </div></li><li class="source" id="l2.2"><div class="plusline">+++ b/foo	Thu Jan 01 00:00:00 1970 +0000
+  </div></li><li class="source" id="l2.3"><div class="atline">@@ -0,0 +1,1 @@
+  </div></li><li class="source" id="l2.4"><div class="plusline">+foo
+  </div></li></ol></div>
   </div>
   
   </div>
diff -r 39a32bcfb658 -r 52ac6e0376d9 tests/test-hgweb-diffs.t
--- a/tests/test-hgweb-diffs.t	Fri May 31 12:25:09 2013 +0400
+++ b/tests/test-hgweb-diffs.t	Thu May 30 20:23:50 2013 +0400
@@ -142,17 +142,17 @@ 
   </table>
   
   <div class="overflow">
-  <div class="sourcefirst">   line diff</div>
+  <div class="sourcefirst"></div>
   
-  <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></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></pre></div>
+  <div class="bottomline"><ol class="parity0 sourcelines"><li class="source" id="l1.1"><div class="minusline">--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  </div></li><li class="source" id="l1.2"><div class="plusline">+++ b/a	Thu Jan 01 00:00:00 1970 +0000
+  </div></li><li class="source" id="l1.3"><div class="atline">@@ -0,0 +1,1 @@
+  </div></li><li class="source" id="l1.4"><div class="plusline">+a
+  </div></li></ol></div><div class="bottomline"><ol class="parity1 sourcelines"><li class="source" id="l2.1"><div class="minusline">--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  </div></li><li class="source" id="l2.2"><div class="plusline">+++ b/b	Thu Jan 01 00:00:00 1970 +0000
+  </div></li><li class="source" id="l2.3"><div class="atline">@@ -0,0 +1,1 @@
+  </div></li><li class="source" id="l2.4"><div class="plusline">+b
+  </div></li></ol></div>
   </div>
   
   </div>
@@ -274,13 +274,13 @@ 
   </table>
   
   <div class="overflow">
-  <div class="sourcefirst">   line diff</div>
+  <div class="sourcefirst"></div>
   
-  <div class="source bottomline parity0"><pre><a href="#l1.1" id="l1.1">     1.1</a> <span class="minusline">--- a/b	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">-b
-  </span></pre></div>
+  <div class="bottomline"><ol class="parity0 sourcelines"><li class="source" id="l1.1"><div class="minusline">--- a/b	Thu Jan 01 00:00:00 1970 +0000
+  </div></li><li class="source" id="l1.2"><div class="plusline">+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  </div></li><li class="source" id="l1.3"><div class="atline">@@ -1,1 +0,0 @@
+  </div></li><li class="source" id="l1.4"><div class="minusline">-b
+  </div></li></ol></div>
   </div>
   </div>
   </div>
@@ -409,19 +409,19 @@ 
   </table>
   
   <div class="overflow">
-  <div class="sourcefirst">   line diff</div>
+  <div class="sourcefirst"></div>
   
-  <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></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></pre></div>
+  <div class="bottomline"><ol class="parity0 sourcelines"><li class="source" id="l1.1"><div>new file mode 100644
+  </div></li><li class="source" id="l1.2"><div class="minusline">--- /dev/null
+  </div></li><li class="source" id="l1.3"><div class="plusline">+++ b/a
+  </div></li><li class="source" id="l1.4"><div class="atline">@@ -0,0 +1,1 @@
+  </div></li><li class="source" id="l1.5"><div class="plusline">+a
+  </div></li></ol></div><div class="bottomline"><ol class="parity1 sourcelines"><li class="source" id="l2.1"><div>new file mode 100644
+  </div></li><li class="source" id="l2.2"><div class="minusline">--- /dev/null
+  </div></li><li class="source" id="l2.3"><div class="plusline">+++ b/b
+  </div></li><li class="source" id="l2.4"><div class="atline">@@ -0,0 +1,1 @@
+  </div></li><li class="source" id="l2.5"><div class="plusline">+b
+  </div></li></ol></div>
   </div>
   
   </div>
@@ -545,11 +545,11 @@ 
   </table>
   
   <div class="overflow">
-  <div class="sourcefirst">   line diff</div>
+  <div class="sourcefirst"></div>
   
-  <div class="source bottomline parity0"><pre><a href="#l1.1" id="l1.1">     1.1</a> old mode 100644
-  <a href="#l1.2" id="l1.2">     1.2</a> new mode 100755
-  </pre></div>
+  <div class="bottomline"><ol class="parity0 sourcelines"><li class="source" id="l1.1"><div>old mode 100644
+  </div></li><li class="source" id="l1.2"><div>new mode 100755
+  </div></li></ol></div>
   </div>
   </div>
   </div>
diff -r 39a32bcfb658 -r 52ac6e0376d9 tests/test-hgweb-removed.t
--- a/tests/test-hgweb-removed.t	Fri May 31 12:25:09 2013 +0400
+++ b/tests/test-hgweb-removed.t	Thu May 30 20:23:50 2013 +0400
@@ -115,13 +115,13 @@ 
   </table>
   
   <div class="overflow">
-  <div class="sourcefirst">   line diff</div>
+  <div class="sourcefirst"></div>
   
-  <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></pre></div>
+  <div class="bottomline"><ol class="parity0 sourcelines"><li class="source" id="l1.1"><div class="minusline">--- a/a	Thu Jan 01 00:00:00 1970 +0000
+  </div></li><li class="source" id="l1.2"><div class="plusline">+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  </div></li><li class="source" id="l1.3"><div class="atline">@@ -1,1 +0,0 @@
+  </div></li><li class="source" id="l1.4"><div class="minusline">-a
+  </div></li></ol></div>
   </div>
   
   </div>
@@ -218,13 +218,13 @@ 
   </table>
   
   <div class="overflow">
-  <div class="sourcefirst">   line diff</div>
+  <div class="sourcefirst"></div>
   
-  <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></pre></div>
+  <div class="bottomline"><ol class="parity0 sourcelines"><li class="source" id="l1.1"><div class="minusline">--- a/a	Thu Jan 01 00:00:00 1970 +0000
+  </div></li><li class="source" id="l1.2"><div class="plusline">+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
+  </div></li><li class="source" id="l1.3"><div class="atline">@@ -1,1 +0,0 @@
+  </div></li><li class="source" id="l1.4"><div class="minusline">-a
+  </div></li></ol></div>
   </div>
   </div>
   </div>