From 1c98d707ce2bccba4efc93bf627aebd609f5dc6e Mon Sep 17 00:00:00 2001
From: Pierre-Yves Chibon <pingou@pingoured.fr>
Date: Mar 21 2016 10:31:51 +0000
Subject: [PATCH 1/3] Small style changes


---

diff --git a/pagure/templates/file.html b/pagure/templates/file.html
index 9259785..fb8377a 100644
--- a/pagure/templates/file.html
+++ b/pagure/templates/file.html
@@ -55,7 +55,7 @@
 
     {% if output_type=='file' %}
         {% autoescape false %}
-        {{ content | format_loc}}
+        {{ content | format_loc }}
         {% endautoescape %}
     {% elif output_type == 'markup' %}
         {% autoescape false %}
@@ -80,7 +80,7 @@
       <div class="card-block p-a-0">
           <table class="table table-sm">
         <tbody>
-                    {% for entry in content %}
+          {% for entry in content %}
             <tr>
                 <td class="pagure-table-icon">
                 {% if entry.filemode == 16384 %}
@@ -100,9 +100,9 @@
                 </a>{% if entry.filemode == 16384 %}</strong>{% endif%}
             </td>
             <td class-"pagure-table-filehex">
-                            {{ entry.hex|short }}
+                {{ entry.hex|short }}
             </td>
-            {% endfor %}
+          {% endfor %}
         </tbody>
       </table>
       </div>

From fcf62c1b31b35f558157e961a194635b78866973 Mon Sep 17 00:00:00 2001
From: Pierre-Yves Chibon <pingou@pingoured.fr>
Date: Mar 21 2016 10:32:34 +0000
Subject: [PATCH 2/3] Adjust the unit-tests for the style change


---

diff --git a/tests/test_pagure_flask_ui_no_master_branch.py b/tests/test_pagure_flask_ui_no_master_branch.py
index efcdd4f..654e910 100644
--- a/tests/test_pagure_flask_ui_no_master_branch.py
+++ b/tests/test_pagure_flask_ui_no_master_branch.py
@@ -293,7 +293,7 @@ class PagureFlaskNoMasterBranchtests(tests.Modeltests):
         self.assertIn('<a href="/test/blob/feature/f/sources">', output.data)
         self.assertIn(
             '<td class-"pagure-table-filehex">\n'
-            '                            9f4435\n            </td>',
+            '                9f4435\n            </td>',
             output.data)
 
         output = self.app.get('/test/tree/feature/sources')
diff --git a/tests/test_pagure_flask_ui_slash_branch_name.py b/tests/test_pagure_flask_ui_slash_branch_name.py
index 84f3fe8..ec477ef 100644
--- a/tests/test_pagure_flask_ui_slash_branch_name.py
+++ b/tests/test_pagure_flask_ui_slash_branch_name.py
@@ -303,7 +303,7 @@ class PagureFlaskSlashInBranchtests(tests.Modeltests):
         self.assertIn('<a href="/test/blob/master/f/sources">', output.data)
         self.assertIn(
             '<td class-"pagure-table-filehex">\n'
-            '                            9f4435', output.data)
+            '                9f4435', output.data)
         self.assertEqual(
             output.data.count('<span class="oi text-muted" data-glyph="file">'), 1)
 
@@ -314,10 +314,10 @@ class PagureFlaskSlashInBranchtests(tests.Modeltests):
             output.data)
         self.assertIn(
             '<td class-"pagure-table-filehex">\n'
-            '                            9f4435', output.data)
+            '                9f4435', output.data)
         self.assertIn(
             '<td class-"pagure-table-filehex">\n'
-            '                            e4e5f6', output.data)
+            '                e4e5f6', output.data)
         self.assertEqual(
             output.data.count('<span class="oi text-muted" data-glyph="file">'), 2)
 
@@ -327,7 +327,7 @@ class PagureFlaskSlashInBranchtests(tests.Modeltests):
         self.assertIn('<a href="/test/blob/master/f/sources">', output.data)
         self.assertIn(
             '<td class-"pagure-table-filehex">\n'
-            '                            9f4435', output.data)
+            '                9f4435', output.data)
         self.assertEqual(
             output.data.count('<span class="oi text-muted" data-glyph="file">'), 1)
 

From 0cbbd3647e3dae8aefb6f6817f6ae469e95a67ae Mon Sep 17 00:00:00 2001
From: Pierre-Yves Chibon <pingou@pingoured.fr>
Date: Mar 21 2016 10:36:38 +0000
Subject: [PATCH 3/3] Adjust the unit-tests for the change in behavior in pygments 2.1.3


---

diff --git a/tests/test_pagure_flask_ui_no_master_branch.py b/tests/test_pagure_flask_ui_no_master_branch.py
index 654e910..7b1de81 100644
--- a/tests/test_pagure_flask_ui_no_master_branch.py
+++ b/tests/test_pagure_flask_ui_no_master_branch.py
@@ -230,8 +230,13 @@ class PagureFlaskNoMasterBranchtests(tests.Modeltests):
             '</li><li class="active"><span class="oi" data-glyph="file">'
             '</span>&nbsp; sources</li>',
             output.data)
-        self.assertIn(
-            '<td class="cell2"><pre>foo</pre></td>', output.data)
+        self.assertTrue(
+            # new version of pygments
+            '<td class="cell2"><pre><span></span>foo</pre></td>' in output.data
+            or
+            # old version of pygments
+            '<td class="cell2"><pre>foo</pre></td>' in output.data
+            )
 
     @patch('pagure.lib.notify.send_email')
     def test_view_raw_file(self, send_email):
diff --git a/tests/test_pagure_flask_ui_repo.py b/tests/test_pagure_flask_ui_repo.py
index 39b5140..ad24261 100644
--- a/tests/test_pagure_flask_ui_repo.py
+++ b/tests/test_pagure_flask_ui_repo.py
@@ -1091,6 +1091,14 @@ class PagureFlaskRepotests(tests.Modeltests):
         self.assertTrue('</a> Authored by Alice Author' in output.data)
         self.assertTrue('Committed by Cecil Committer' in output.data)
         self.assertTrue(
+            # new version of pygments
+            '<div class="highlight" style="background: #f8f8f8">'
+            '<pre style="line-height: 125%">'
+            '<span></span>'
+            '<span style="color: #800080; font-weight: bold">'
+            '@@ -0,0 +1,3 @@</span>' in output.data
+            or
+            # old version of pygments
             '<div class="highlight" style="background: #f8f8f8">'
             '<pre style="line-height: 125%">'
             '<span style="color: #800080; font-weight: bold">'
diff --git a/tests/test_pagure_flask_ui_slash_branch_name.py b/tests/test_pagure_flask_ui_slash_branch_name.py
index ec477ef..61cb737 100644
--- a/tests/test_pagure_flask_ui_slash_branch_name.py
+++ b/tests/test_pagure_flask_ui_slash_branch_name.py
@@ -233,7 +233,12 @@ class PagureFlaskSlashInBranchtests(tests.Modeltests):
             '<li class="active"><span class="oi" data-glyph="file">'
             '</span>&nbsp; .gitignore</li>',
             output.data)
-        self.assertIn('<td class="cell2"><pre>*~</pre></td>', output.data)
+        self.assertTrue(
+            # new version of pygments
+            '<td class="cell2"><pre><span></span>*~</pre></td>' in output.data
+            or
+            # old version of pygments
+            '<td class="cell2"><pre>*~</pre></td>' in output.data)
 
     @patch('pagure.lib.notify.send_email')
     def test_view_raw_file(self, send_email):

