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
b43a3a58
Commit
b43a3a58
authored
8 years ago
by
Ximin Luo
Browse files
Options
Downloads
Patches
Plain Diff
Set limits to inf when parsing args, instead of checking for "> 0" everywhere
parent
341be077
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
diffoscope/difference.py
+3
-3
3 additions, 3 deletions
diffoscope/difference.py
diffoscope/main.py
+2
-2
2 additions, 2 deletions
diffoscope/main.py
diffoscope/presenters/html.py
+1
-1
1 addition, 1 deletion
diffoscope/presenters/html.py
with
6 additions
and
6 deletions
diffoscope/difference.py
+
3
−
3
View file @
b43a3a58
...
...
@@ -110,7 +110,7 @@ class DiffParser(object):
if
line
[
0
]
in
(
'
-
'
,
'
+
'
)
and
line
[
0
]
==
self
.
_direction
:
self
.
_block_len
+=
1
max_lines
=
Config
.
general
.
max_diff_block_lines
if
max_lines
>
0
and
self
.
_block_len
>=
max_lines
:
if
self
.
_block_len
>=
max_lines
:
return
self
.
skip_block
else
:
self
.
_block_len
=
1
...
...
@@ -229,14 +229,14 @@ def make_feeder_from_raw_reader(in_file, filter=lambda buf: buf):
line_count
=
0
end_nl
=
False
h
=
None
if
max_lines
>
0
:
if
max_lines
<
float
(
"
inf
"
)
:
h
=
hashlib
.
sha1
()
for
buf
in
in_file
:
line_count
+=
1
out
=
filter
(
buf
)
if
h
:
h
.
update
(
out
)
if
max_lines
==
0
or
line_count
<
max_lines
:
if
line_count
<
max_lines
:
out_file
.
write
(
out
)
end_nl
=
buf
[
-
1
]
==
'
\n
'
if
h
and
line_count
>=
max_lines
:
...
...
This diff is collapsed.
Click to expand it.
diffoscope/main.py
+
2
−
2
View file @
b43a3a58
...
...
@@ -165,9 +165,9 @@ class ListToolsAction(argparse.Action):
def
maybe_set_limit
(
config
,
parsed_args
,
key
):
v
=
getattr
(
parsed_args
,
key
)
if
v
is
not
None
:
setattr
(
config
,
key
,
v
)
setattr
(
config
,
key
,
float
(
"
inf
"
)
if
v
==
0
else
v
)
elif
parsed_args
.
no_max_limits
:
setattr
(
config
,
key
,
0
)
setattr
(
config
,
key
,
float
(
"
inf
"
)
)
def
run_diffoscope
(
parsed_args
):
...
...
This diff is collapsed.
Click to expand it.
diffoscope/presenters/html.py
+
1
−
1
View file @
b43a3a58
...
...
@@ -190,7 +190,7 @@ def create_limited_print_func(print_func, max_page_size):
limited_print_func
.
char_count
=
0
print_func
(
s
)
limited_print_func
.
char_count
+=
len
(
s
)
if
not
force
and
max_page_size
>
0
and
limited_print_func
.
char_count
>=
max_page_size
:
if
not
force
and
limited_print_func
.
char_count
>=
max_page_size
:
raise
PrintLimitReached
()
return
limited_print_func
...
...
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