Add infrastructure for binary file patching in rbt patch.
Review Request #14711 — Created Nov. 28, 2025 and updated — Latest diff uploaded
This adds the core infrastructure needed to support binary file patching
when applying review request diffs usingrbt patch.
rbtools.diffs.patches.BinaryFilePatchrepresents binary files in the
diff, and can lazily load their content as-needed.
rbtools.diffs.patcher.Patchernow has several methods to apply binary
files in various ways. They can be overridden by SCM-specific patchers
to perform file operations as necessary.
rbtools.diffs.patches.PatchResultwill now track which binary files
were applied (or failed).The
rbt patchcommand has been updated to:
- Fetch binary file metadata from diff and commit resources.
- Pass binary files to
Patchinstances. - Report binary file application results
- Add the new
--no-binaryoption, which skips patching binary files.
Subsequent changes will add support for individual SCM systems.
- Ran unit tests.
- Used this in conjunction with later changes to actually apply patches
that include binary files.