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
6db6cae8
Commit
6db6cae8
authored
5 years ago
by
Chris Lamb
Browse files
Options
Downloads
Patches
Plain Diff
Abstract out the duplicated parts of the diffoscope/comparators/debian_fallback.py class.
parent
8b33709a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#137168
passed
5 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
diffoscope/comparators/debian_fallback.py
+9
-25
9 additions, 25 deletions
diffoscope/comparators/debian_fallback.py
with
9 additions
and
25 deletions
diffoscope/comparators/debian_fallback.py
+
9
−
25
View file @
6db6cae8
...
...
@@ -21,10 +21,7 @@
from
.text
import
TextFile
class
DotChangesFile
(
TextFile
):
DESCRIPTION
=
"
Debian .changes files
"
FILE_EXTENSION_SUFFIX
=
'
.changes
'
class
AbstractDebianFallbackFile
(
TextFile
):
def
compare
(
self
,
other
,
*
args
,
**
kwargs
):
difference
=
super
().
compare
(
other
,
*
args
,
**
kwargs
)
if
not
difference
:
...
...
@@ -35,29 +32,16 @@ class DotChangesFile(TextFile):
return
difference
class
Dot
DscFile
(
Text
File
):
DESCRIPTION
=
"
Debian .
dsc
files
"
FILE_EXTENSION_SUFFIX
=
'
.
dsc
'
class
Dot
ChangesFile
(
AbstractDebianFallback
File
):
DESCRIPTION
=
"
Debian .
changes
files
"
FILE_EXTENSION_SUFFIX
=
'
.
changes
'
def
compare
(
self
,
other
,
*
args
,
**
kwargs
):
difference
=
super
().
compare
(
other
,
*
args
,
**
kwargs
)
if
not
difference
:
return
None
difference
.
add_comment
(
'
Unable to find the
"
debian
"
Python module. Falling back to text comparison.
'
)
return
difference
class
DotDscFile
(
AbstractDebianFallbackFile
):
DESCRIPTION
=
"
Debian source packages (.dsc)
"
FILE_EXTENSION_SUFFIX
=
'
.dsc
'
class
DotBuildinfoFile
(
Text
File
):
class
DotBuildinfoFile
(
AbstractDebianFallback
File
):
DESCRIPTION
=
"
Debian .buildinfo files
"
FILE_EXTENSION_SUFFIX
=
'
.buildinfo
'
def
compare
(
self
,
other
,
*
args
,
**
kwargs
):
difference
=
super
().
compare
(
other
,
*
args
,
**
kwargs
)
if
not
difference
:
return
None
difference
.
add_comment
(
'
Unable to find the
"
debian
"
Python module. Falling back to text comparison.
'
)
return
difference
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