Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
diffoscope
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Reproducible Builds
diffoscope
Commits
7479e160
Commit
7479e160
authored
8 years ago
by
Chris Lamb
Browse files
Options
Downloads
Patches
Plain Diff
presenters.text: Apply --max-report-size to --text reports. (Closes: #851147)
Signed-off-by:
Chris Lamb
<
lamby@debian.org
>
parent
2003d090
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
diffoscope/presenters/text.py
+12
-2
12 additions, 2 deletions
diffoscope/presenters/text.py
with
12 additions
and
2 deletions
diffoscope/presenters/text.py
+
12
−
2
View file @
7479e160
...
...
@@ -20,8 +20,9 @@
import
re
from
diffoscope.diff
import
color_unified_diff
from
diffoscope.config
import
Config
from
.utils
import
Presenter
from
.utils
import
Presenter
,
create_limited_print_func
,
PrintLimitReached
class
TextPresenter
(
Presenter
):
...
...
@@ -29,11 +30,20 @@ class TextPresenter(Presenter):
RE_PREFIX
=
re
.
compile
(
r
'
(^|\n)
'
)
def
__init__
(
self
,
print_func
,
color
):
self
.
print_func
=
print_func
self
.
print_func
=
create_limited_print_func
(
print_func
,
Config
().
max_report_size
,
)
self
.
color
=
color
super
().
__init__
()
def
start
(
self
,
difference
):
try
:
super
().
start
(
difference
)
except
PrintLimitReached
:
self
.
print_func
(
"
Max output size reached.
"
,
force
=
True
)
def
visit_difference
(
self
,
difference
):
if
self
.
depth
==
0
:
self
.
output
(
"
--- {}
"
.
format
(
difference
.
source1
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment