Merge lp:~jugmac00/loggerhead/fix-viewing-large-files into lp:loggerhead

Proposed by Jürgen Gmach
Status: Merged
Approved by: Colin Watson
Approved revision: 522
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: lp:~jugmac00/loggerhead/fix-viewing-large-files
Merge into: lp:loggerhead
Diff against target: 86 lines (+42/-1)
5 files modified
NEWS (+5/-0)
loggerhead/highlight.py (+1/-1)
loggerhead/tests/__init__.py (+1/-0)
loggerhead/tests/test_highlight.py (+33/-0)
requirements.txt (+2/-0)
To merge this branch: bzr merge lp:~jugmac00/loggerhead/fix-viewing-large-files
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Jelmer Vernooij Approve
Review via email: mp+418309@code.launchpad.net

Commit message

Fix highlighting for large files

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Still LGTM, thanks!

review: Approve
Revision history for this message
Jürgen Gmach (jugmac00) wrote (last edit ):

Thanks Jelmer!

So, now I am stuck. How do I get this merged now?

Is there buildbot involved so it would be enough to mark this MP as "approved"?

If not, I'd appreciate detailed instructions.

My current status - I have committed and pushed from the local `fix-viewing-large-files` directory/branch:

```
~/bzr/loggerhead via 🐍 v3.8.10 (venv)
❯ brz status
unknown:
  fix-viewing-large-files
```

Revision history for this message
Colin Watson (cjwatson) wrote :

There's a Jenkins job that should deal with merges. I'll try top-approving this and see whether it works.

Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'NEWS'
--- NEWS 2020-07-08 17:14:19 +0000
+++ NEWS 2022-04-03 12:48:33 +0000
@@ -1,6 +1,11 @@
1What's changed in loggerhead?1What's changed in loggerhead?
2=============================2=============================
33
4unreleased
5----------
6
7 - Fix highlighting for large files. (Jürgen Gmach, #1966702)
8
41.20.091.20.0
5----10----
611
712
=== modified file 'loggerhead/highlight.py'
--- loggerhead/highlight.py 2021-11-15 14:40:11 +0000
+++ loggerhead/highlight.py 2022-04-03 12:48:33 +0000
@@ -37,7 +37,7 @@
37 """37 """
3838
39 if len(text) > MAX_HIGHLIGHT_SIZE:39 if len(text) > MAX_HIGHLIGHT_SIZE:
40 return map(escape, breezy.osutils.split_lines(text))40 return list(map(escape, breezy.osutils.split_lines(text)))
4141
42 formatter = HtmlFormatter(style=style, nowrap=True, classprefix='pyg-')42 formatter = HtmlFormatter(style=style, nowrap=True, classprefix='pyg-')
4343
4444
=== modified file 'loggerhead/tests/__init__.py'
--- loggerhead/tests/__init__.py 2018-10-20 15:28:43 +0000
+++ loggerhead/tests/__init__.py 2022-04-03 12:48:33 +0000
@@ -32,4 +32,5 @@
32 'test_revision_ui',32 'test_revision_ui',
33 'test_templating',33 'test_templating',
34 'test_util',34 'test_util',
35 'test_highlight',
35 ]])36 ]])
3637
=== added file 'loggerhead/tests/test_highlight.py'
--- loggerhead/tests/test_highlight.py 1970-01-01 00:00:00 +0000
+++ loggerhead/tests/test_highlight.py 2022-04-03 12:48:33 +0000
@@ -0,0 +1,33 @@
1# Copyright 2022 Canonical Ltd
2#
3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by
5# the Free Software Foundation; either version 2 of the License, or
6# (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program; if not, write to the Free Software
15# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
17from breezy import tests
18
19from ..highlight import highlight
20
21
22class TestHighLight(tests.TestCase):
23 def test_no_highlighting_for_big_texts(self):
24 rv = highlight(
25 path="",
26 text="text\n" * 102401, # bigger than MAX_HIGHLIGHT_SIZE
27 encoding="utf-8",
28 )
29 self.assertIsInstance(rv, list)
30 self.assertLength(102401, rv)
31 # no highlighting applied
32 for item in rv:
33 self.assertEqual("text\n", item)
034
=== modified file 'requirements.txt'
--- requirements.txt 2022-02-23 19:28:51 +0000
+++ requirements.txt 2022-04-03 12:48:33 +0000
@@ -9,3 +9,5 @@
9bleach < 4.0.0; python_version <= "3.5"9bleach < 4.0.0; python_version <= "3.5"
10packaging < 21.0; python_version <= "3.5"10packaging < 21.0; python_version <= "3.5"
11https://www.owlfish.com/software/simpleTAL/downloads/SimpleTAL-5.2.tar.gz11https://www.owlfish.com/software/simpleTAL/downloads/SimpleTAL-5.2.tar.gz
12Pygments < 2.6; python_version < "3"
13Pygments; python_version >= "3"

Subscribers

People subscribed via source and target branches