Commit 50bced37 authored by Jelmer Vernooij's avatar Jelmer Vernooij

Add a --diff option.

parent 5d9b8c8c
......@@ -3,6 +3,7 @@ lintian-brush (0.7) UNRELEASED; urgency=medium
* Add fixer for package-needs-versioned-debhelper-build-depends.
* Add fixer for package-uses-deprecated-debhelper-compat-version
* Add support for fixing debhelper-but-no-misc-depends.
* Add a --diff option.
-- Jelmer Vernooij <jelmer@debian.org> Fri, 09 Nov 2018 21:07:23 +0000
......
......@@ -63,6 +63,8 @@ def main(argv=None):
parser.add_argument(
'--directory', metavar='DIRECTORY', help='directory to run in',
type=str, default='.')
parser.add_argument(
'--diff', help='Print resulting diff afterwards.', action='store_true')
parser.add_argument(
'fixers', metavar='FIXER', nargs='*',
help='specific fixer to run')
......@@ -89,6 +91,7 @@ def main(argv=None):
note('Unable to open tree at %s: missing package %s',
args.directory, e.library)
return 1
since_revid = wt.last_revision()
if args.fixers:
fixers = [f for f in fixers if f.name in args.fixers]
with wt.lock_write():
......@@ -113,6 +116,11 @@ def main(argv=None):
if failed and not args.verbose:
note("Some fixer scripts failed to run: %r. "
"Run with --verbose for details.", set(failed))
if args.diff:
from breezy.diff import show_diff_trees
show_diff_trees(
wt.branch.repository.revision_tree(since_revid),
wt, sys.stdout.buffer)
if __name__ == '__main__':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment