diff tests/test-hgweb-diffs.t @ 19432:e92d4b8530cb

hgweb: file diff and changesets views behave like file source view This gives all the benefits introduced before for file source view, namely code selection without line numbers and correct indents, highlighting line which is linked to, long lines wrapping. Implementation strategy is also the same as for file source view: all the lines are put in a sigle pre tag with span's for each line. Correct line numbering (same as before this patch) is achieved with nested CSS counters.
author Alexander Plavin <me@aplavin.ru>
date Sat, 13 Jul 2013 00:57:10 +0400
parents c3cdba6e5d7f
children a79b21ece345
line wrap: on
line diff
--- a/tests/test-hgweb-diffs.t	Fri Jul 12 23:47:56 2013 +0400
+++ b/tests/test-hgweb-diffs.t	Sat Jul 13 00:57:10 2013 +0400
@@ -142,17 +142,18 @@
   </table>
   
   <div class="overflow">
-  <div class="sourcefirst">   line diff</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="sourcefirst"> line diff</div>
+  <div class="stripes2 diffblocks">
+  <div class="bottomline inc-lineno"><pre class="sourcelines wrap">
+  <span id="l1.1" class="minusline">--- /dev/null	Thu Jan 01 00:00:00 1970 +0000</span><a href="#l1.1"></a>
+  <span id="l1.2" class="plusline">+++ b/a	Thu Jan 01 00:00:00 1970 +0000</span><a href="#l1.2"></a>
+  <span id="l1.3" class="atline">@@ -0,0 +1,1 @@</span><a href="#l1.3"></a>
+  <span id="l1.4" class="plusline">+a</span><a href="#l1.4"></a></pre></div><div class="bottomline inc-lineno"><pre class="sourcelines wrap">
+  <span id="l2.1" class="minusline">--- /dev/null	Thu Jan 01 00:00:00 1970 +0000</span><a href="#l2.1"></a>
+  <span id="l2.2" class="plusline">+++ b/b	Thu Jan 01 00:00:00 1970 +0000</span><a href="#l2.2"></a>
+  <span id="l2.3" class="atline">@@ -0,0 +1,1 @@</span><a href="#l2.3"></a>
+  <span id="l2.4" class="plusline">+b</span><a href="#l2.4"></a></pre></div>
+  </div>
   </div>
   
   </div>
@@ -271,13 +272,14 @@
   </table>
   
   <div class="overflow">
-  <div class="sourcefirst">   line diff</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="sourcefirst"> line diff</div>
+  <div class="stripes2 diffblocks">
+  <div class="bottomline inc-lineno"><pre class="sourcelines wrap">
+  <span id="l1.1" class="minusline">--- a/b	Thu Jan 01 00:00:00 1970 +0000</span><a href="#l1.1"></a>
+  <span id="l1.2" class="plusline">+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000</span><a href="#l1.2"></a>
+  <span id="l1.3" class="atline">@@ -1,1 +0,0 @@</span><a href="#l1.3"></a>
+  <span id="l1.4" class="minusline">-b</span><a href="#l1.4"></a></pre></div>
+  </div>
   </div>
   </div>
   </div>
@@ -403,19 +405,20 @@
   </table>
   
   <div class="overflow">
-  <div class="sourcefirst">   line diff</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="sourcefirst"> line diff</div>
+  <div class="stripes2 diffblocks">
+  <div class="bottomline inc-lineno"><pre class="sourcelines wrap">
+  <span id="l1.1">new file mode 100644</span><a href="#l1.1"></a>
+  <span id="l1.2" class="minusline">--- /dev/null</span><a href="#l1.2"></a>
+  <span id="l1.3" class="plusline">+++ b/a</span><a href="#l1.3"></a>
+  <span id="l1.4" class="atline">@@ -0,0 +1,1 @@</span><a href="#l1.4"></a>
+  <span id="l1.5" class="plusline">+a</span><a href="#l1.5"></a></pre></div><div class="bottomline inc-lineno"><pre class="sourcelines wrap">
+  <span id="l2.1">new file mode 100644</span><a href="#l2.1"></a>
+  <span id="l2.2" class="minusline">--- /dev/null</span><a href="#l2.2"></a>
+  <span id="l2.3" class="plusline">+++ b/b</span><a href="#l2.3"></a>
+  <span id="l2.4" class="atline">@@ -0,0 +1,1 @@</span><a href="#l2.4"></a>
+  <span id="l2.5" class="plusline">+b</span><a href="#l2.5"></a></pre></div>
+  </div>
   </div>
   
   </div>
@@ -536,11 +539,12 @@
   </table>
   
   <div class="overflow">
-  <div class="sourcefirst">   line diff</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="sourcefirst"> line diff</div>
+  <div class="stripes2 diffblocks">
+  <div class="bottomline inc-lineno"><pre class="sourcelines wrap">
+  <span id="l1.1">old mode 100644</span><a href="#l1.1"></a>
+  <span id="l1.2">new mode 100755</span><a href="#l1.2"></a></pre></div>
+  </div>
   </div>
   </div>
   </div>