[diffoscope] 06/06: html-dir: Show start of diff on parent page, even when split over child pages

Ximin Luo infinity0 at debian.org
Mon Sep 5 17:19:35 UTC 2016


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

infinity0 pushed a commit to branch better-lazy-loading
in repository diffoscope.

commit ebbf88382a0762166f10e3d6cd9489b8ee790113
Author: Ximin Luo <infinity0 at debian.org>
Date:   Mon Sep 5 19:14:01 2016 +0200

    html-dir: Show start of diff on parent page, even when split over child pages
    
    Also change the functionality of the flags so they are more consistent across
    different output modes. Previously, the behaviour of the flags differed wildly
    across both --html and --html-dir output, such that it was hard to control one
    output without affecting the other in a counterintuitive way. For example:
    
    1. max-diff-block-lines applied to the entire diff block even when it was split
    across child pages. This meant that max-report-size as applied to the parent
    page, gave wildly different results. For --html output, each diff block would
    be relatively large and so not many diff blocks would be shown (for a given
    max-report-size), but for --html-dir, many diff blocks would be shown since
    lots of them would go onto child pages. However, if one wanted to increase
    max-report-size to allow more diff blocks to be shown for --html, this would
    *also* increase the amount of diff shown for each child page for --html-dir.
    
    2. separate-file-diff-size would affect the parent page in unpredictable ways:
    if the diff block had N lines, it would be shown on the parent page, but if it
    had N+1 lines, then 0 of these lines would be shown on the parent page. This
    would also affect how how many diff blocks are shown later as part of the
    max-report-size limits.
    
    In this commit, we remove separate-file-diff-size, and change the semantics of
    max-diff-block-lines to display this many lines of diff on the parent page
    regardless of how large the whole diff block is. This prevents any unintuitive
    {N -> N, N+1 -> 0} "jumps" in behaviour, and the behaviour of the parent page
    is also more predictable and intuitive. To control the child pages, we add
    max-diff-block-lines-html-dir. This limits the number of lines shown across all
    split children for a given diff block; the size of each child page is capped to
    roughly max-report-size / 4. Notably, this *only* affects the child pages and
    *not* the parent page; and max-diff-block-lines now has the same effect for
    both --html and --html-dir output.
    
    In order to do this, we have to also ditch the previous behaviour where
    max-diff-block-lines would interfere with diff's output on a deeper level,
    hiding it from *all* readers. If this is really needed, we can add it back in
    under a different name, that makes it obvious it operates at this deeper level
    instead of merely affecting the diff visual output.
---
 diffoscope/config.py                 |  21 ++--
 diffoscope/difference.py             |  12 ---
 diffoscope/main.py                   |  44 +++++---
 diffoscope/presenters/html.py        | 150 +++++++++++++++------------
 tests/data/ps_internal_expected_diff | 194 ++++++++++++++++++++++++++++++++++-
 tests/test_difference.py             |   7 --
 6 files changed, 318 insertions(+), 110 deletions(-)

diff --git a/diffoscope/config.py b/diffoscope/config.py
index 97a1182..89d9a1c 100644
--- a/diffoscope/config.py
+++ b/diffoscope/config.py
@@ -28,12 +28,13 @@ class classproperty(property):
 class Config(object):
     def __init__(self):
         # 0 to disable max
-        self._max_diff_block_lines = 8192
-        self._max_diff_input_lines = 2 ** 20 # GNU diff cannot process arbitrary large files :(
         self._max_report_size = 2000 * 2 ** 10 # 2000 kB
-        self._separate_file_diff_size = 200 * 2 ** 10 # 200kB
+        self._max_diff_block_lines = 50
+        self._max_diff_block_lines_html_dir = 1024
+        self._max_diff_input_lines = 2 ** 20 # GNU diff cannot process arbitrary large files :(
         self._fuzzy_threshold = 60
         self._new_file = False
+        self._html_dir_parent_child_ratio = 4
 
     @classproperty
     def general(cls):
@@ -42,6 +43,10 @@ class Config(object):
         return cls._general_config
 
     @property
+    def html_dir_parent_child_ratio(self):
+        return self._html_dir_parent_child_ratio
+
+    @property
     def max_diff_block_lines(self):
         return self._max_diff_block_lines
 
@@ -66,12 +71,12 @@ class Config(object):
         self._max_report_size = value
 
     @property
-    def separate_file_diff_size(self):
-        return self._separate_file_diff_size
+    def max_diff_block_lines_html_dir(self):
+        return self._max_diff_block_lines_html_dir
 
-    @separate_file_diff_size.setter
-    def separate_file_diff_size(self, value):
-        self._separate_file_diff_size = value
+    @max_diff_block_lines_html_dir.setter
+    def max_diff_block_lines_html_dir(self, value):
+        self._max_diff_block_lines_html_dir = value
 
     @property
     def fuzzy_threshold(self):
diff --git a/diffoscope/difference.py b/diffoscope/difference.py
index edffc72..67a88af 100644
--- a/diffoscope/difference.py
+++ b/diffoscope/difference.py
@@ -109,23 +109,11 @@ class DiffParser(object):
         self._diff.write(line)
         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:
-                return self.skip_block
         else:
             self._block_len = 1
             self._direction = line[0]
         return self.read_hunk
 
-    def skip_block(self, line):
-        if self._remaining_hunk_lines == 0 or line[0] != self._direction:
-            self._diff.write('%s[ %d lines removed ]\n' % (self._direction, self._block_len - Config.general.max_diff_block_lines))
-            return self.read_hunk(line)
-        self._block_len += 1
-        self._remaining_hunk_lines -= 1
-        return self.skip_block
-
-
 
 
 DIFF_CHUNK = 4096
diff --git a/diffoscope/main.py b/diffoscope/main.py
index 1a65b65..2d92eb7 100644
--- a/diffoscope/main.py
+++ b/diffoscope/main.py
@@ -67,32 +67,46 @@ def create_parser():
     parser.add_argument('--text', metavar='output', dest='text_output',
                         help='write plain text output to given file (use - for stdout)')
     parser.add_argument('--no-max-limits', action='store_true', default=False,
-                        help='Disable all default limits.')
+                        help='Disable all default limits. Note that text output '
+                        'already ignores all limits, both manual and default.')
     parser.add_argument('--max-report-size', metavar='BYTES',
                         dest='max_report_size', type=int,
-                        help='maximum bytes written in report (default: %d, 0 to disable)' %
-                        Config.general.max_report_size,
+                        help='maximum bytes written in report. in html-dir '
+                        'output, this is instead the max bytes of the parent '
+                        'page, and %d * the max bytes of the child page. '
+                        '(default: %d, 0 to disable)' %
+                        (Config.general.html_dir_parent_child_ratio,
+                        Config.general.max_report_size),
                         default=None).completer=RangeCompleter(0,
                         Config.general.max_report_size, 200000)
-    parser.add_argument('--separate-file-diff-size', metavar='BYTES',
-                        dest='separate_file_diff_size', type=int,
-                        help='diff size to load diff on demand, with --html-dir (default: %(default)s)',
-                        default=Config.general.separate_file_diff_size).completer=RangeCompleter(0,
-                        Config.general.separate_file_diff_size, 20000)
-    parser.add_argument('--max-diff-block-lines', dest='max_diff_block_lines', type=int,
-                        help='maximum number of lines per diff block (default: %d, 0 to disable)' %
+    parser.add_argument('--max-diff-block-lines', dest='max_diff_block_lines',
+                        metavar='LINES', type=int,
+                        help='maximum number of lines output per diff block. '
+                        'for --html-dir, this is the maximum number of lines '
+                        'output on the parent page; extra lines are output on '
+                        'child pages up to --max-diff-block-lines-html-dir '
+                        'lines. (default: %d, 0 to disable)' %
                         Config.general.max_diff_block_lines,
                         default=None).completer=RangeCompleter(0,
                         Config.general.max_diff_block_lines, 5)
-    parser.add_argument('--max-diff-input-lines', dest='max_diff_input_lines', type=int,
-                        help='maximum number of lines fed to diff (default: %d, 0 to disable)' %
+    parser.add_argument('--max-diff-block-lines-html-dir', dest='max_diff_block_lines_html_dir',
+                        metavar='LINES', type=int,
+                        help='in --html-dir output, this is maximum number of '
+                        'lines (over all pages) output per diff block, '
+                        '(default: %d, 0 to disable)' %
+                        Config.general.max_diff_block_lines_html_dir,
+                        default=None).completer=RangeCompleter(0,
+                        Config.general.max_diff_block_lines_html_dir, 200)
+    parser.add_argument('--max-diff-input-lines', dest='max_diff_input_lines',
+                        metavar='LINES', type=int,
+                        help='maximum number of lines fed to diff(1) '
+                        '(default: %d, 0 to disable)' %
                         Config.general.max_diff_input_lines,
                         default=None).completer=RangeCompleter(0,
                         Config.general.max_diff_input_lines, 5000)
     parser.add_argument('--fuzzy-threshold', dest='fuzzy_threshold', type=int,
                         help='threshold for fuzzy-matching '
-                             '(0 to disable, %d is default, 400 is high fuzziness)' %
-                             (Config.general.fuzzy_threshold),
+                        '(0 to disable, %(default)s is default, 400 is high fuzziness)',
                         default=Config.general.fuzzy_threshold).completer=RangeCompleter(0,
                         400, 20)
     parser.add_argument('--new-file', dest='new_file', action='store_true',
@@ -174,8 +188,8 @@ def run_diffoscope(parsed_args):
     if not tlsh and Config.general.fuzzy_threshold != parsed_args.fuzzy_threshold:
         logger.warning('Fuzzy-matching is currently disabled as the “tlsh” module is unavailable.')
     maybe_set_limit(Config.general, parsed_args, "max_report_size")
-    Config.general.separate_file_diff_size = parsed_args.separate_file_diff_size
     maybe_set_limit(Config.general, parsed_args, "max_diff_block_lines")
+    maybe_set_limit(Config.general, parsed_args, "max_diff_block_lines_html_dir")
     maybe_set_limit(Config.general, parsed_args, "max_diff_input_lines")
     Config.general.fuzzy_threshold = parsed_args.fuzzy_threshold
     Config.general.new_file = parsed_args.new_file
diff --git a/diffoscope/presenters/html.py b/diffoscope/presenters/html.py
index 248111c..82cc6c4 100644
--- a/diffoscope/presenters/html.py
+++ b/diffoscope/presenters/html.py
@@ -204,6 +204,9 @@ UD_TABLE_FOOTER = u"""<tr class="ondemand"><td colspan="4">
 class PrintLimitReached(Exception):
     pass
 
+class DiffBlockLimitReached(Exception):
+    pass
+
 
 def create_limited_print_func(print_func, max_page_size):
     def limited_print_func(s, force=False):
@@ -216,16 +219,10 @@ def create_limited_print_func(print_func, max_page_size):
     return limited_print_func
 
 
-def estimate_num_rows_per_page(separate_file_diff_size):
-    # each row takes about 1200 bytes in the output, so roughly calculate
-    # the number of rows that 4 * separate_file_diff_size will hold
-    return separate_file_diff_size * 4 // 1024
-
-
 buf, add_cpt, del_cpt = [], 0, 0
 line1, line2, has_internal_linenos = 0, 0, True
 hunk_off1, hunk_size1, hunk_off2, hunk_size2 = 0, 0, 0, 0
-spl_rows, spl_bytes, spl_current_page = 0, 0, 0
+spl_rows, spl_current_page = 0, 0
 spl_print_func, spl_print_ctrl = None, None
 
 
@@ -233,12 +230,12 @@ def new_unified_diff():
     global buf, add_cpt, del_cpt
     global line1, line2, has_internal_linenos
     global hunk_off1, hunk_size1, hunk_off2, hunk_size2
-    global spl_rows, spl_bytes, spl_current_page
+    global spl_rows, spl_current_page
     global spl_print_func, spl_print_ctrl
     buf, add_cpt, del_cpt = [], 0, 0
     line1, line2, has_internal_linenos = 0, 0, True
     hunk_off1, hunk_size1, hunk_off2, hunk_size2 = 0, 0, 0, 0
-    spl_rows, spl_bytes, spl_current_page = 0, 0, 0
+    spl_rows, spl_current_page = 0, 0
     spl_print_func, spl_print_ctrl = None, None
 
 
@@ -460,12 +457,17 @@ def spl_print_enter(print_context, rotation_params):
     global spl_print_func, spl_print_ctrl
     spl_print_ctrl = print_context.__exit__, rotation_params
     spl_print_func = print_context.__enter__()
-    _, _, css_url, _ = rotation_params
+    _, _, css_url = rotation_params
     # Print file and table headers
     output_header(css_url, spl_print_func)
 
+def spl_had_entered_child():
+    global spl_print_ctrl, spl_current_page
+    return spl_print_ctrl and spl_print_ctrl[1] and spl_current_page > 0
+
 def spl_print_exit(*exc_info):
     global spl_print_func, spl_print_ctrl
+    if not spl_had_entered_child(): return False
     output_footer(spl_print_func)
     _exit, _ = spl_print_ctrl
     spl_print_func, spl_print_ctrl = None, None
@@ -475,31 +477,48 @@ def spl_print_exit(*exc_info):
 def spl_file_printer(directory, filename):
     with codecs.open(os.path.join(directory,filename), 'w', encoding='utf-8') as f:
         print_func = f.write
-        max_page_size = Config.general.max_report_size
-        def limited_print_func(s, force=False):
-            global spl_bytes
+        def recording_print_func(s, force=False):
             print_func(s)
-            spl_bytes += len(s)
-            if not force and max_page_size > 0 and spl_bytes >= max_page_size:
-                raise PrintLimitReached()
-        yield limited_print_func
+            recording_print_func.bytes_written += len(s)
+        recording_print_func.bytes_written = 0
+        yield recording_print_func
 
 def row_was_output():
     global spl_print_func, spl_print_ctrl, spl_rows, spl_current_page
     spl_rows += 1
-    if not spl_print_ctrl:
-        return
     _, rotation_params = spl_print_ctrl
-    directory, mainname, css_url, rows_per_page = rotation_params
-    if spl_rows % rows_per_page != 0:
+    max_lines = Config.general.max_diff_block_lines
+    max_lines_html_dir = Config.general.max_diff_block_lines_html_dir
+    if not rotation_params:
+        # html-dir single output, don't need to rotate
+        if max_lines > 0 and spl_rows >= max_lines:
+            raise DiffBlockLimitReached()
         return
-    spl_current_page += 1
+    else:
+        # html-dir output, perhaps need to rotate
+        directory, mainname, css_url = rotation_params
+        if max_lines_html_dir > 0 and spl_rows >= max_lines_html_dir:
+            raise DiffBlockLimitReached()
+
+        if spl_current_page == 0: # on parent page
+            if max_lines == 0 or spl_rows < max_lines:
+                return
+        else: # on child page
+            max_report_size = Config.general.max_report_size / Config.general.html_dir_parent_child_ratio
+            # TODO: make this stay below the max, instead of going 1 row over the max
+            # will require some backtracking...
+            if spl_print_func.bytes_written < max_report_size:
+                return
 
+    spl_current_page += 1
     filename = "%s-%s.html" % (mainname, spl_current_page)
-    # close the current page
-    spl_print_func(UD_TABLE_FOOTER % {"filename": html.escape(filename), "text": "load diff"}, force=True)
-    spl_print_exit(None, None, None)
-    # rotate to the next page
+
+    if spl_current_page > 1:
+        # previous page was a child, close it
+        spl_print_func(UD_TABLE_FOOTER % {"filename": html.escape(filename), "text": "load diff"}, force=True)
+        spl_print_exit(None, None, None)
+
+    # rotate to the next child page
     context = spl_file_printer(directory, filename)
     spl_print_enter(context, rotation_params)
     spl_print_func(UD_TABLE_HEADER)
@@ -513,7 +532,9 @@ def output_unified_diff_table(unified_diff, _has_internal_linenos):
     has_internal_linenos = _has_internal_linenos
     spl_print_func(UD_TABLE_HEADER)
     try:
+        bytes_processed = 0
         for l in unified_diff.splitlines():
+            bytes_processed += len(l) + 1
             m = re.match(r'^--- ([^\s]*)', l)
             if m:
                 empty_buffer()
@@ -583,47 +604,47 @@ def output_unified_diff_table(unified_diff, _has_internal_linenos):
             empty_buffer()
 
         empty_buffer()
+        return True
+    except DiffBlockLimitReached:
+        total = len(unified_diff)
+        bytes_left = total - bytes_processed
+        frac = bytes_left / total
+        spl_print_func(
+            u"<tr class='error'>"
+            u"<td colspan='4'>Max diff block lines reached; %s/%s bytes (%.2f%%) of diff not shown."
+            u"</td></tr>" % (bytes_left, total, frac*100), force=True)
+        return False
+    except PrintLimitReached:
+        assert not spl_had_entered_child() # limit reached on the parent page
+        spl_print_func(u"<tr class='error'><td colspan='4'>Max output size reached.</td></tr>", force=True)
+        raise
     finally:
         spl_print_func(u"</table>", force=True)
 
 
 def output_unified_diff(print_func, css_url, directory, unified_diff, has_internal_linenos):
-    global spl_print_func, spl_current_page
+    global spl_print_func, spl_print_ctrl, spl_current_page
     new_unified_diff()
-    if directory and len(unified_diff) > Config.general.separate_file_diff_size:
-        # open a new file for this table
+    rotation_params = None
+    if directory:
         mainname = hashlib.md5(unified_diff.encode('utf-8')).hexdigest()
-        filename="%s.html" % mainname
-        logger.debug('separate html output for diff of size %d', len(unified_diff))
-        num_pages = 0
-        truncated = False
-        rows_per_page = estimate_num_rows_per_page(Config.general.separate_file_diff_size)
-        rotation_params = directory, mainname, css_url, rows_per_page
-        try:
-            spl_print_enter(spl_file_printer(directory, filename), rotation_params)
-            output_unified_diff_table(unified_diff, has_internal_linenos)
-        except PrintLimitReached:
-            truncated = True
-            spl_print_func(u"<table><tr class='error'><td colspan='4'>Max output size reached.</td></tr></table>",
-                           force=True)
-            spl_print_exit(None, None, None) # swallow
-        except:
-            if not spl_print_exit(*sys.exc_info()): raise
-        else:
-            spl_print_exit(None, None, None)
-        finally:
-            num_pages = spl_current_page + 1
-
-        text = "load diff (%s pieces%s)" % (num_pages, (", truncated" if truncated else ""))
-        print_func(UD_TABLE_HEADER, force=True)
-        print_func(UD_TABLE_FOOTER % {"filename": html.escape(filename), "text": text}, force=True)
-
+        rotation_params = directory, mainname, css_url
+    try:
+        spl_print_func = print_func
+        spl_print_ctrl = None, rotation_params
+        truncated = not output_unified_diff_table(unified_diff, has_internal_linenos)
+    except:
+        if not spl_print_exit(*sys.exc_info()): raise
     else:
-        try:
-            spl_print_func = print_func
-            output_unified_diff_table(unified_diff, has_internal_linenos)
-        finally:
-            spl_print_func = None
+        spl_print_exit(None, None, None)
+    finally:
+        spl_print_ctrl = None
+        spl_print_func = None
+
+    if spl_current_page > 0:
+        noun = "pieces" if spl_current_page > 1 else "piece"
+        text = "load diff (%s %s%s)" % (spl_current_page, noun, (", truncated" if truncated else ""))
+        print_func(UD_TABLE_FOOTER % {"filename": html.escape("%s-1.html" % mainname), "text": text}, force=True)
 
 
 def output_difference(difference, print_func, css_url, directory, parents):
@@ -725,13 +746,10 @@ def output_html_directory(directory, difference, css_url=None, jquery_url=None):
     if jquery_url == 'disable':
         jquery_url = None
 
-    if Config.general.separate_file_diff_size:
-        num_rows = estimate_num_rows_per_page(Config.general.separate_file_diff_size)
-        if Config.general.max_diff_block_lines and Config.general.max_diff_block_lines < num_rows:
-            logger.info('You selected a very low --max-diff-block-lines=%s; it\'s '+
-                        'unlikely that --separate-file-diff-size=%s will have any effect.',
-                        Config.general.max_diff_block_lines,
-                        Config.general.separate_file_diff_size)
+    if Config.general.max_diff_block_lines_html_dir <  Config.general.max_diff_block_lines:
+        raise ValueError(
+            "bad config values: max_diff_block_lines_html_dir (%s) < max_diff_block_lines (%s)" %
+            (Config.general.max_diff_block_lines_html_dir,  Config.general.max_diff_block_lines))
 
     with file_printer(directory, "index.html") as print_func:
         print_func = create_limited_print_func(print_func, Config.general.max_report_size)
diff --git a/tests/data/ps_internal_expected_diff b/tests/data/ps_internal_expected_diff
index f0cf9c5..4fe972a 100644
--- a/tests/data/ps_internal_expected_diff
+++ b/tests/data/ps_internal_expected_diff
@@ -97,7 +97,103 @@
 -12C0D6DDD6E89A3BA6468B6322EF1ED480FC2C330B4F75B2FB0D5A087CE736B1
 -4E6BB73F418498D5F66A9DF2917F9F373AA2297896E42772AE3E18655C54F2B8
 -8C06C928783AE7E32CC7F03BDC4066D87357A596FA9B3C3E63A7C479F07E8EA3
--[ 97 lines removed ]
+-E64470B60D44B75B84AAC49B9A6A90B0A4495B1941E759A7CA742F6AD10F9B59
+-C3CDC8D90DAF8986077461DA65D90F77DC54EF0373067DE4140769C6465E94B1
+-5A93BD1623C150EF1EE877962760F05FDC2EC3B6AD34DFD639D65782267E8E51
+-3128B955D4FE716C9A261EEF9C1A0425B819E333CBA03E8D661CF115FB195E7C
+-3DE00E3A29FCCAE10A43014D5BF8AC10D649329CCCC022E606A5A0A1C98CC87E
+-8404F4926454C7DBC47FFF0AC85CC5CF0BDE09CAF9705983A587B32742316AED
+-9FB7B3F3932C95DA1F517990FCB1B4367BCC520C3B289FCC7E35FAC7092AB97B
+-20AA7D44F7766B8BB5A695A267912A438EDB2C736C7BA6755991D3219344B09A
+-A7661BEA37D4837B15B1067B67999997E37D5BD59A5E8B912F8F30F5584EEF58
+-4B46A5B574446C8334CD8BEBA270E9EF0E4F0D7B69C5ED963399EB3291F47F19
+-6748FE7E05B02F79771611D5A3155F3C7701166C8EB0B6A9E9BF359679ECF605
+-96666690AB674AA9346A60C985268D237FAEE252E83674BCDE538254FF6985BE
+-B99D01AC96BEC46E11F65A68C934C671570A5D40B7F3B6A6238EA4EE091F0F64
+-21A37026A09C6904308D106C37021E1141BFB960D819C0CC308C23E08B05AF93
+-163F8C79ADCB215635D473B68803F5BFBA022867E12D1FC895CD7B5EC4B6E52A
+-7491F83160DCC3D9D3277DD9077D5F9814C468D3637034D28CF748A7274C2EDC
+-4EEB95F0EDAF77FE542075A2DF749043F3BBB98C15CB863D46647CAC9E960CB3
+-9CE1ABF3C2425AA7F16E3E3CBFA7B3018334C8DF5FF541A89173AE31944A826E
+-39ED576E7E792D7F9D36520C59DFCEB7C24F8AC9C2A3FFE9F393CC7AE1021180
+-70054C243ADAB55FAD00EDF032E6E6E8B7C49F2CF28600D53EA5CA6B6423D92C
+-9986D30BDC5198A5C3A0604326A47C5BB592E2E8DBF253366475897D14A97E86
+-03912768935539A025637B3F3D941EAB629A97F530C7565657A0C457E350F758
+-CAA0D914C88A74B792EB8BB5DC4904581FA7D87575A3A7CF327BD31EBD45EBFF
+-BD84FA0BF8935D8D49BCFD7E7E0A23C7E7AF6ED4574AE0520EA3E52350A0E872
+-CFFD9E8BD6C54A2B5AEDD65707959C94AC3790EEF76D3F3AC9C795B3ECE17740
+-296FEE99988E871ABB9E905D3283709EA6FD6398A83D1D06B9BA0307C8C9FDBF
+-600845E7463853A60C3FABBF623AAE7F0B3C60777EE935BF70BC156329719515
+-6B1E4BA88A3D8F4BDE985E76372F039DEDB0C26A82C1287AF9CF4ED7AC771B30
+-AE2A5B9C455B5BD57D20D44A808D678A5A5725E20047A0E073B31F0F5CB01928
+-5B3897F78125A366B11B15F77CC4DCBAC194AA69864C3516469D1D7065F1C85F
+-2FC836297170D8C292640F80FBF03EB2590D3A3C150F2C4A36A3F5E26CB86519
+-DF021AA87A10252634CF4EED81FA707075814BCA50E5ED3DB845E4FEBF0884FF
+-81C3E0F0FF74EA455ADD6E2CB74BDFE06A790950E13749FFECD3136903300768
+-78623E5FD0113869FC30A301DBB9899B0980EEF27FF33ACBBE4F1FCD9DB9BF5F
+-2F8D8B0AE7402EF0233CE106F07BA2FFE97C13FF25EE91FEEE3EAAA8DD70B4E5
+-993274D3413EB273A9ED0BD78448C004DAA54B13D64B267422165DCAA8CE8C28
+-5663F4329597EB39163239900E4BAD7DA863D621240BB9E1AD8BB4F87712B83A
+-03E7B361A6BE76EA7E65F8637057B911BD3F8A7CE522C4F741FA3DCA9BEBD325
+-8199920C5A77E117F8475C0158622044C14C8460A0D464B6A5F4290581959836
+-F1EACB72EA9A5C96557C1DBD79110A1FDDC7A829E0918071BC8EE966E8C8132A
+-399AFC5383B8A555A195DE676102B0B9E22A47E0FD79E2C90A6443EC9F49C41E
+-26FA7EBD6D767A197D0D4DF43FE74B9807FF6930C302311C993EBC7D359EBC5C
+-CC672A2E3269DC1588530888A81FA4688A01E64B9D449AB4D916EFA148F06381
+-9927D2E7BE6A6EFA13D225EEB07D81FDB0C9F32CA5537A22EF942AB12F6C71DF
+-B898B0F0045A6DA6E479D42F971B7240FB605F647B41BF8564820F5B568F5341
+-ADFE18CE181F2BA5808C528191E1C8B2AD34B64EC3871D25F39C3E477F543893
+-AC88C9E8E5CCC0403FD08BC1EAD90ACD7490C0A9BB68CBF46867C6475306E731
+-C8D87447F9C2D9A7C482BD520A98175CBC2216D91E29C7CC3F5F15CA343EA6E2
+-7B195DB92B7B0AC8D80D17A04F4745E74CAD0820680A3BF17CDFFDBB859C9B11
+-370D45F29842CD1D54D828C926BC16A6051E2332E8B7A92B269688F11467D65A
+-E4C9049F180AC2DDCFA405A4B74D846F019F8192AD6469A4511965178CC031BC
+-C671E9A543A7967826FD4095A5EFB1DDA14667401768E8B67F4827DC032F69A5
+-33A4B67EBBEA5C7C40DE44A743751A6D9D9D186483BBA665A933061E6D8424FA
+-4D70905203E4AF7ADC2E0832686B7AEC505DCB8A85CBAE00AAF9EF20EAF4C269
+-D872480779CB89F77592555A6ECD8CB98FCCA21BDBEE9F34C5070E89EB9D104E
+-DFADD85269AE7C9F549C12E49641AC656CE39E0E2BDF3BEAD2AB9165670F5435
+-4EDD4DFED6DBD462BD4A96AB063D847463013AC44C0EC3E06E79BB04E035C906
+-21CE50314291838C458655DBFB86DB4C35E2A49B7071DF126CEAC58CBDCAC57D
+-5A4F84266410D98D715EC7C6BEEE7CD453870383664A5DCBF68A2F9922C5657A
+-C822491E464A658EF6FD519F8A7D9F7F373142C83DE8B7379DF7C38DD213FBEB
+-B4FD42A70F5B9D6554AA30AEE1EF6D1A4EB99CE26C93D85975EE1046FC64B730
+-4D5E3C794C801E591978FEBBEE0513909690F1943740FE73E511A02752E9F7BA
+-419A22899376291AEC16C406B58BCAF3ED2316460BFE59B1948D1F6D68C99C22
+-93CA2F47FE17E3295A2DAC9027A0CC40375D60509FF1912ECA1AAFDEF3DDBEAB
+-3D07AEC239ABFC5FF282A8DFED095BCB1A5A205D4828648E9694E35EFBF5EA61
+-8836280FA0E3D038166FF8AE4B869905F61719593DCA9EA78F0AD3F36BEF85F8
+-634366C6A6E66F0B2CAF2BE9024A9F07A03830B7365E7E73BBA4A0E4BF8D96D5
+-27F3FAE60E98699ACCDC3A4DB94FC6D9178F62A212F4354923A9FE165F0127B5
+-EDF8D67EC6E45B4DCE0FF68D69EFB4AEF06AF51FFD8A5796F21C3F38BBE71D4A
+-8624F7E50EE40183B27E7E8B18DFC06CC02DD8B136145BF9A0DE190978C151DE
+-AF9EA9653101E2C59486869F2C0406FA114970533E7EBCA203B12F165F5C2FE3
+-BAC5D8BD676A29B9B39093FECD6FE1359BC30EAF5BEE9E8E2CE6CB9B19A1972C
+-2E0130639FA82166AB75BECDA0748F943BFBADB6C1D7892997735CFF53A96442
+-E7D8C15C5F798DB39A6509A9070FA646AD1F6C6699B1DC2FB188DCF27841AF31
+-E9B33E5512B18DAEA4C13009D1F92E19125993D8FF9644FCAB7414B9C12DF2FD
+-2582BFECE2748197527C72887F1F99A69D53ADAB8B63A1A5E98108903E217EEA
+-883238C475D5F614F12ED200366E4CB6B5F6AA0BB3DC7966C8F53BFF21269EA7
+-3E4298CBBF5D26480B352CC4794FFC86B7BF44ED8428DAE123038AE9562EC04F
+-6B0076BD8DBD24BC330AD9399972A4A946274DAD61A9CD621AD2D5FCB45F0E12
+-31B3A19589BE6B9CEEC530FB1140513DE6235A1ABCE7E5A8800F0282C6C24986
+-878404BE7530ED3C96AF4E6DA0D2CF1DE8465174D15F44D7862A7E3C3CF4FFFA
+-35E934817E2B36D6FECEEB999B16EF4708A9847D91D9713AA964AB7D478E1279
+-C271DBDAEAE17E25066F66DBB2E9E7365AA9BBCCB252B5A64FB861C354F67679
+-0FABE7C1ED3AB761033816D6BB0CB3B1151B38E242B6DEDA236400CA5031FDF2
+-6B5DC7199DB1F96936821C41833A3FDBCCEE2D9B8972EB0EC4EB3D96641AED5E
+-DCA22A1289EE25829AD85161AE66B7FC93FAB4F34050643755FBFB7EFF6C973C
+-F35E6E854758E20AEFFE435C8619AC965398791211854463046528B56391E346
+-88F32602BB7FC9D49DC864D46D2C87BFA05D3879BEB4750E40B6D63D95BE26E2
+-F15B297294F2D05191976FDEE7875AFB62B8A9440A89EFD07EDE787EE2FF7EA0
+-AC68A183CBECFA1D4FBA38E56DC4706628BA076E777D4F0A008BA42216C6D764
+-AC7049319ACADAFEFD29C2A6D33101A11A86C6C3D6C90E61AADD9BA9953AB485
+-2E4D97980DE948833674441085011CCA763F0D567229AE757AF842B3B0D93E10
+-1A3166A10A960A44D18F7A8A6C0E2CB2C0B8589F4E23256FA9B09291CDBC7DCB
+-8E9E2BFB1B0973B9FE24E1C8E120B73F095111BA6DE38E87FF1C3260F551B086
+-1C5BF9EB95B9AD45339406EFF08FDFA1844CD74AC4D4030821694A847954A0A7
+-7D9BBA6F55CC1AB951A815739957D880AF37670B212503106815E2177E710C64
+-829762B16BB57CD6AE5A668289CECFE1072F6D5900DAEEBCF093
 +4B25D6FDDD45956A8ECAC7D4E624353575E13D49DD5AF366220D2AB92888B070
 +2B8643F60A51A6ED31906F0AAE5F86D5AF28522D7DDE76E26C270701183E0047
 +942C30D06D4F9BF3327B9AF9CAFBCA001B7C0328E4C7DB807BBDAD0771EC0FEF
@@ -148,7 +244,101 @@
 +83CD370CE208AAC25A0E32F30EADF2050B71A795EA13A4D07728245BAE9EAAED
 +C600B0EF658DD1A4D02466F90AB4EA0F908B64D5B00832EE12C40DC0B0A5E893
 +4FDB520A423CF5ECC910C11C01905E075CD64CDD83F0A08473FB9DBC1ECE9471
-+[ 95 lines removed ]
++DE4399253D03E14A188BE5141A4062A50486D93EAEC19E116B4B8868053D57D0
++75935171EA1FDAD0E9501C46438C1763EFACA456CD55E427A4B35DDD5758CD18
++F678A95D1852957A849CE61DFCBC439708A42CD21CBCB198B7A370C52111D69B
++EF5C94E4D9D4A04FD82D259DD6DB7156CB5466B191EEE609E483D0012938367F
++3E568AAEFF333C21B11E27911E8A4A15C1DD1640104C322503F37A5A5ECF6980
++EA7317FE6AF1C31BA121A215078860FFF5548ECEC922E75955E8D643E8CE7C64
++24D33213B8D517AC827AE8F7075698E46D7BE31EB6A4CE7C16C4B3BA7A574D04
++3A76B249973D0B9E19C2D340CE23AA1E6D5D83072EB94F3358D7CACE85A35C05
++7F5C92141B37BE3DD8F4ABD4C6C2F2F4496FD3908090F860D09DB32951F54138
++43CC6664B2E25B48CA4AEFECF53BE8B30003C4ADC44AEC249D487AD6D0A02A67
++1001BC44508F84EB15F6BB2E774E3BD6EBCCF6ECB7D5DC0A521A02BD6044AD80
++4A571CEEB648BC7B6201FB42AA8EB8D88C032F6923692D4284A46F3FC0780000
++EC8E85C7D47557C950EA0CA5F1807D0292AB7441F18B999CEEA4EB2712C91D8C
++ADCCD80329CD494C0847D1F16CDE35A06301FFD26A3647271CEAFB80233112D6
++B33DFECEC2256D8744FEB8AD680C4C735A9B08AF8F7757A96B6D8207E75DF7C7
++665356FF04664D3F7F2453F488E11B5810B1EB019DC417AE160647EC43BCD4F1
++091E59E2D9A6DEA764D0D27EC86FFB089A9503D7553371571DBA06CBE97E9A49
++3027E3FEA2442566F2535BCAD5AAF50EEAE27373AF98EFD7ABFF7B8AA3866FB2
++47E94D79476064C6B40073A8076696CA9D12C1AB0579126883B8DD5AB04F805E
++878946C0808216311AB77A0C29FBBC15D8F35C647F3950DE2E0AE28C4B0147F5
++6AA18B3DBAA7CC79FB47976881358B2576FCEB0C9AE72E39865E404E77BC8229
++A810CED272DB3ED593F8A8390B7E572BC156EBDB449F156FD04C715A3040F33F
++F95CE5565495A5978375152F81E7215119A409D7F26568B22C4662A96B02D389
++4FDAE224F3A220F49F8F753BC676AF9517288610DF5FCF72C64977041CCAC8C8
++C110F1B0D5A33FBA3123F08CF4DEFC763916A6DB6D476420CE0E6992C7F0038F
++F519807D39C49D1590493A248E6F095517A2FCCC9DBB56EFEEFDD32C0FB8C9F2
++E4E11CEE209E5F7C13C7D4CF096EA47E012C3FCDF53F52F4F637D7BCEA2A6835
++B660CDFE9AE8E8FCF703BAA08D393AA0BA0A23A9B4D47A1CB2C78E9F8069449A
++723C38CD00FA7659B2409DA3F7C63A78A34E53649E3B1D7183F5780551B0B98F
++F73D42AA13C6FB7B5935A8938A0F5DBE18334BB631F2D5D02C5FA53F8BBC2D30
++7557FC7362F543411DCCA48A24EDFCC4C859D6330A63524DDB0B3CA4D345877D
++CE7EBA6C246542D253A89E1CAA482F2E48AA56435AA133FE758F4BD72875FA57
++09B56EA703211C2D6FB43BBFEEFD7AFB7EB6ACE1CE7CE8C9646142E4B244E66A
++85E4A21021E1BB294A2825E732E9D3531C871D1C63000CEC9C89A53C14764C3B
++E26C58207AAC906CD37142AF5339162727ED8C461C1F820BF97CC3ADD6B2A5D3
++5DEEA6755C401F422475FB6EB91EA078653744D8AB3417DD3F4D52F1B0DB5D68
++B20AE03459A0EF07659E7A90F3D5A1631807C9E9561F4BCFBD5BBF158F301224
++333D08BED33B43D781ED5C07699B9736D92D3B9407789360536D6D1231C4A3F3
++45CC27F8AB92E7A79B2C55DB06808BA42233BB7ABDECCE4958A02CFC4ECFD680
++54BC2D4F39FFF5B35CBD4DC37391A1457D59835B31633807D438D88141DEF145
++C773E93AE5D16E785D10C41EC26695E98A712AF908A0BE226DD0E61A199A22AB
++F47F0398A493991C57FBD364EE10D2D0DF7E2C602B088459F75F394542597F86
++776B8C31F710A1FFA1A8CA2B4877FBE1FC7B6E935403C68352BE2640537BDE9A
++191B86C353DB1793EFB4C3D5673133416041FFBE267A3B386BF7342CD03BC49A
++D9429952D2AF6D0208AEC4035D71CC153B2F53D88DD4933F95AA0ABBCA0769F0
++B85DBC79FB2936DF611E46519A5358FB08E21673F29578CA715F29CB22648A1D
++857741988E315FBE0C08871F4295CE738DE4A8572C9166CDDC3EC808A584DAB4
++664799A9AB516A9F0F51C7364CEDB5525E0CDA9F4B32B895976CC5F4A409D6B3
++E170526A37ADE42FF748B4F5702F0F061F83E586C14533C6AAFB75C42D534C1E
++CED0A6A9BFAA49F87CE3E65FDB0DDCE342F7BDA18B90CA794374BD32A0B5B7E6
++1EF0D2B8CD79CF8E4787795EECF348DC8E2DBD5876C15E3BBAB2532DF001BDA4
++CC4F54B3215D52D55FD27F24C524E7CFBF5E5D354F14104128369260BA6CF5AA
++8BE3EEE611C4FFC04DDCF340B8C7745F8D8AE1EA344644DD21335C0CBE551424
++67D8FA67C7C521FE3555BFFDCBBFB5E6EBF5ADDCCA45B1252FB2EC4FFE26A1AB
++03592F937209EDF01E64F413180CF3F6A668CB85D6A1FA413BA91FC2C9BDCBB3
++BC7C8267F87FE5C2B84FE0430838076C1F54585B7C572C12D87955C75D1914B1
++5EC0A95ED945831B14F54C5D99928275BF4A33646A3A99A65C55A2C49BCCF5D2
++E3F01A66364D4BFD3AD3572ED41BE2DAF80B16A4EA9C04AF731311328AC6EAAD
++D03886242C76AE8C01893B527D2CC609A71150EB44DAFF14731C0BA560A1C290
++0D93C77411BAB98C1236D9DF6F49943ABC69F0F2778731705AC3627C34215739
++8A3D9FCE819A2B2BE945A7DD7E2009B9E6ABF868AB6F2269079E4B12DB3A8FD6
++9783A34D2F9F6145899EA835B3F8B613B2B6AEB90975C2F94939839EBAFEAA16
++D06F80624ED16B812DF666BFE1348843EEE84E7B7833FED6D84E6F65F853E146
++0AE080B79ADC3E282B129B1A68A7A7A2012B57EFD3148EA7566DAB7C6138A6A4
++93EC15564B3836F70A1935FE73DFD34AC9ACAA60ED026535BC058784B5C7C82F
++9E0D241EF877621D168825E2CFDD136193E30C4EA3F9B0CBD698F88E6566D177
++942233D0EC0A9B60F193FAA528FD8D6B653D7F6DB241E5415CF34C15E337E74D
++D4AE2E27C086FBD5DE3A52A1D31FC251B4D1EA9993D0C03C57A1FCC39A1EC75F
++08C2845E7DA9F3689DBC97C0CFEE0546D007576F8218630FC25DB8035AFC68AA
++A22CCEF577FD4BFE4C1FF2A22D5042B2A916058F765CD6E5D30CD165F70F9F39
++953865DAD8A9442A230031D0A919EBF456FE031D6B1BE0C7D5D8F1399203B42E
++D7201D82660E309F53F510EB527235D8B1F80E822F08E7D32862FBB603738B27
++D1C0703BE4B32DBE38143CED975131E91B2D6D0913D08B55B5BFDFCA34E6BDDE
++6CE25F766F82E3EA7B986E40183C0ADEB410A40589139BCC2A3B58D6B5E4A21B
++70C4A984EE0B66CB421ADF5101D1095EC16768FF672742373C4F822579C56908
++3E083804BC25A9C1DD5E571BCAEF898990534F8CA68840D3080AB0DE80E1AA81
++8FD97803F7F67345EF73A609EA29CDACDDD10F89A049643310298E5A74812E55
++732E0921950D286C3BB8130B8383FFC74822BB8F46DFA4A8964D2C8A0E8D02E2
++EB73D4E7D5E677B9ED24D76003490B47D77CFCF27C502E134F9B0A58B1EFA344
++A73D5408A113935F894F330F2F62F52D774F81224C29A3219E39AE63151E691B
++D54556E17F89031AF131E6FB3AEBAEAC93DDFEDB8CDD87E9F56CF6249097306E
++15CF8C670B335D41F59317F44AC0AC460F38C9375A50F48E048D73A364C9A349
++9F2530D83F6621EF71106CF7DFFFDC29B337D843EF17D75C5A6D244BF52267A7
++CAF36A9DDCEE69D30447C349C5A6CF10C324DBA6675731B3312F2DCBCCA1FD1E
++609A4203B80E421BC1C440B64995392336AE538232C13966698914244AFE816C
++F04C80FBF6E052087D557D1585821545730623BCD485D1E8F0803EFCE197F62D
++DA58D11A9DCD7C536DF916C623F0AFA628461DE72BF61C8B564670E51D361F55
++B7B0D0728B3668576C1346890C27A2CC90111D5D6AFC8E06C9CF064EBE2E3253
++54BD68854E315F3D4A0FF29CEBF8A7D5E372882AFA43DD10F163E26DD283C77C
++E8B055992E1629C593EC28B5ECE0BDD42F6E1AABE45C6E160A700F3F75F11BA1
++F4D0F7E1EB7848B72FF625C9567BD588C022CAA2DC6606EA0CFE6F762FAF615E
++F4F8A205AC917CE938461057B47AD99CC2C66AF70B73C39A43EB686C8A803AE9
++3231F55087A56DE3A7DF0BA0DF74A64B324B0554EBD31C5318B59F987DC2D804
++B852838A5C06276A97D6D3AA747B38E7F7A8BA46D0E17DB201417C8355415E67
++C990413F049A21A5FE7E42035208DF556E253342802A0D
  0000000000000000000000000000000000000000000000000000000000000000
  0000000000000000000000000000000000000000000000000000000000000000
  0000000000000000000000000000000000000000000000000000000000000000
diff --git a/tests/test_difference.py b/tests/test_difference.py
index 1c01cbf..3349523 100644
--- a/tests/test_difference.py
+++ b/tests/test_difference.py
@@ -31,13 +31,6 @@ def test_too_much_input_for_diff(monkeypatch):
     difference = Difference.from_text_readers(too_long_text_a, too_long_text_b, 'a', 'b')
     assert '[ Too much input for diff ' in difference.unified_diff
 
-def test_too_long_diff_block_lines(monkeypatch):
-    monkeypatch.setattr(Config, 'max_diff_block_lines', 10)
-    too_long_text_a = io.StringIO("a\n" * 21)
-    too_long_text_b = io.StringIO("b\n" * 21)
-    difference = Difference.from_text_readers(too_long_text_a, too_long_text_b, 'a', 'b')
-    assert '[ 11 lines removed ]' in difference.unified_diff
-
 def test_non_str_arguments_to_source1_source2():
     a = io.StringIO('a')
     b = io.StringIO('b')

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



More information about the Reproducible-commits mailing list