[diffoscope] 05/06: main: temporarily add old flags back for backwards-compatibility

Ximin Luo infinity0 at debian.org
Thu Jul 6 10:51:09 CEST 2017


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch WIP/humungous-diffs
in repository diffoscope.

commit 076e6cbaad6e426d424c2e5b197f748736d1e6d1
Author: Ximin Luo <infinity0 at debian.org>
Date:   Wed Jul 5 22:52:01 2017 +0200

    main: temporarily add old flags back for backwards-compatibility
---
 diffoscope/main.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/diffoscope/main.py b/diffoscope/main.py
index bf8f829..0db0228 100644
--- a/diffoscope/main.py
+++ b/diffoscope/main.py
@@ -145,6 +145,9 @@ def create_parser():
                         'effect even with --no-default-limits)', default=
                         Config().max_page_size_child).completer=RangeCompleter(
                         Config().max_page_size_child)
+    # TODO: old flag kept for backwards-compat, drop 6 months after v84
+    group2.add_argument('--max-report-size-child', metavar='BYTES', type=int,
+                        help=argparse.SUPPRESS, default=None)
     group2.add_argument('--max-page-diff-block-lines', metavar='LINES', type=int,
                         help='Maximum number of lines output per unified-diff block '
                         'on the top-level (--html-dir) or sole (--html) page, before '
@@ -154,6 +157,9 @@ def create_parser():
                         'effect even with --no-default-limits)', default=
                         Config().max_page_diff_block_lines).completer=RangeCompleter(
                         Config().max_page_diff_block_lines)
+    # TODO: old flag kept for backwards-compat, drop 6 months after v84
+    group2.add_argument("--max-diff-block-lines-parent", metavar='LINES', type=int,
+                        help=argparse.SUPPRESS, default=None)
 
     group3 = parser.add_argument_group('diff calculation')
     group3.add_argument('--new-file', action='store_true',
@@ -311,7 +317,16 @@ def run_diffoscope(parsed_args):
     maybe_set_limit(Config(), parsed_args, "max_text_report_size")
     maybe_set_limit(Config(), parsed_args, "max_diff_block_lines")
     Config().max_page_size = parsed_args.max_page_size
+    # TODO: old flag kept for backwards-compat, drop 6 months after v84
+    if parsed_args.max_report_size_child is not None:
+        logger.warning("Detected deprecated flag --max-report-size-child; use --max-page-size-child instead.")
+        Config().max_page_size_child = parsed_args.max_report_size_child
     Config().max_page_size_child = parsed_args.max_page_size_child
+    # TODO: old flag kept for backwards-compat, drop 6 months after v84
+    if parsed_args.max_diff_block_lines_parent is not None:
+        logger.warning("Detected deprecated flag --max-diff-block-lines-parent; use --max-page-diff-block-lines instead.")
+        logger.warning("Note that the new flag --max-page-diff-block-lines also applies to --html output.")
+        Config().max_page_diff_block_lines = parsed_args.max_diff_block_lines_parent
     Config().max_page_diff_block_lines = parsed_args.max_page_diff_block_lines
 
     maybe_set_limit(Config(), parsed_args, "max_diff_block_lines_saved")

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list