Fix showing indentation changes on interdiffs in partly-invalid chunks.
Review Request #5544 — Created Feb. 25, 2014 and submitted — Latest diff uploaded
When generating interdiffs, we figure out which chunks we actually want
to show any change information for, restricting it to chunks matching
the ranges indicated in the actual diff files.The problem is, the way this interacts with "equals" computation (where
we strip two otherwise "equal" lines) can cause indentation information to
be filtered out. This happens because any chunk that isn't completely
within a valid range will get filtered out. Even though an indentation
change is an actual change line, we make it appear as an "equal", which
appears to span beyond those ranges.To fix this, we needed to break up any chunks sitting on a valid range
boundary, keeping those parts of the chunks and turning the remains into
a filtered-equal chunk.We then needed to convert the "filtered-equal" chunks to "equal" and
stitch those back together into "equal" chunks later. We already had
processors to do both of these things, but the one for merging adjacent
chunks happened right after interdiff filtering (which was too soon). We
now do this and convert back to "equal" in the post-processing meta
stage. At this stage, we also know about indentation information, so we
can also single those out as their own chunks, sanely.
Tested with the diff where I first noticed this. The indentation markers
were missing in an interdiff before, but are shown now. The lines of context
around it were correct.Tested with my other interdiff review requests, and compared before/after.
They seemed fine. In particular, I tested with my regression test review request
designed to ensure indentation changes are hidden when outside of valid interdiff
filter ranges.Unit tests pass.
We will want to pay attention in interdiffs after this goes in, in case there
are any regressions.