Formalize diff line-level metadata and prepare for new state.
Review Request #11902 — Created Jan. 4, 2022 and submitted
Lines in a rendered diff have a dictionary field for storing move
information, and we have a couple other fields for other interesting
state. What we don't have is a field for general metadata, and this will
be important soon.It will also be important not to completely break anything consuming
this line information. So, the moved information field is being
repurposed for general metadata, preservingto
andfrom
as moved
to/from keys.For the moment, this is mostly a documentation change within the chunk
generator. However, thediff_line
template tag has also been updated
to prepare for some uses of this metadata field. This consists of
pulling out the field into a variable, and changing some processing to
avoid repeating logic (which will be important for the upcoming code
safety checks feature).
Unit tests passed.
Made use of this in the upcoming code safety checkers feature.
- Change Summary:
-
- Fixed typos in documentation.
- Condensed some logic for better readability.
- Moved this to release-5.0.x.
- Commits:
-
Summary ID 2ce72fdc49581f1e92a2cf242d501f879ac7aaaa 799199c194f9206b965e0766f929c2b1820b9905 - Branch:
-
release-4.0.xrelease-5.0.x