Add formal storage of symlink targets when parsing diffs.
Review Request #12066 — Created Feb. 20, 2022 and submitted — Latest diff uploaded
FileDiffboth contained information on whether a
file was a symlink, but nothing more than that. There was no information
on targets, meaning that it was up to the diff implementation and
patchto generate a suitable symlink for display or when applying a
patch. This wasn't ideal.
ParsedDiffFilenow contains typed attributes for old and new symlink
targets. These are optional, but can be set by the diff parser. The
DiffX parser is currently the only one that sets these.
FileDiffprovides attributes for getting or setting all symlink state.
These all wrap
extra_data, giving us a formal way of working with
An upcoming SCM will need thess. A separate upcoming change will enable
this support for Git (and Mercurial by extension). Eventually, we'll be
able to use these to avoid some hacks we're currently using to render
symlink changes in diffs.
This will also be useful for Review Bot and RBTools, which will benefit
from being able to know how to correctly manage symlinks.
Unit tests pass.