Update rbt patch for typing, the new Patch class, and crash fixes.
Review Request #13970 — Created June 10, 2024 and submitted — Latest diff uploaded
rbt patchnow has type hints all throughout. This helped catch some
places where we were mixing types, leading to crashes. Notably, JSON
output would crash when dealing with conflicting files represented as
Unicode strings (which are expectd due to the type hints) rather than
byte strings.It now uses the
Patchclass to track patches to apply, wrapped by a
smallPendingPatchInfodictionary with the rest of the information
that it needs to track.This is in preparation for using new patching logic for more SCM-driven
patch application, which is in development now.As a note, the
Patchcommand has been renamed toPatchCommand, to
avoid conflicts with thePatchclass. This will require those using
the development tree to re-runpip install -e .to register the new
entrypoint.