Modernize rbt patch and rework it for full DVCS support.
Review Request #10818 — Created Jan. 6, 2020 and updated
rbt patchnow has full support for patching, outputting, reverting,
and committing single-diff review requests and multi-commit review
requests. When working with Review Board 3.0 or lower, it behaves as it
did before, applying the patch either locally or as a commit based on
the review request's summary and author information.
When working with a multi-commit review request, patches can be applied
sequentially (the default) or squashed, which only makes a difference
when committing. Subsets of commits can also be applied. The ordering of
those commits on the review request are always respected.
Reverting will always apply in the reverse order, ensuring that they're
backed out correctly. When committing the reverted patches, each commit
message will begin with
As part of a modernization effort, all output is now done through
exceptions or logging statements, and the text is localized. While we're
not set up for localization today, the patch code does have a lot of
messages that differ depending on the number of patches, so it made
sense to begin using this here. There are plans to move to a better
approach for command-driven output, which would replace some of this
logging code, but that will be done separately.
Tested this months ago when the code was originally written. This needs
some additional real-world testing, and is being put up for review to
help with that effort.