chipx86 got a fish trophy!
Add a Patcher class for handling the application of patches.
Review Request #14041 — Created July 14, 2024 and submitted
The new
Patcher
class is responsible for taking a list of patches and
applying or reverting them, optionally committing them as well.Consumers of
Patcher
are expected to provide the list of patches to
apply (each being aPatch
object), the destination path (optionally),
any information known about the repository, and flags to initiate a
revert or squash of the patches.If the patches are to be committed, they're then expected to call
prepare_for_commit()
. Then,patch()
can be called.
Patcher.patch()
is a generator, taking care to apply each patch in
order and yielding a successful result for each or raising an exception.
Consumers can use the generator nature of this tool to help with
progress reporting.By default, this interfaces with the local
patch
tool, supporting both
GNU Patch and Apple/BSD Patch. It takes care to examine output for both
tools and convert them into suitable responses. Subclasses can override
the methods to instead interface with SCM-specific patching tools, and
to even take care to apply or commit multiple patches in one go instead
of individually (which is needed for Mercurial).Follow-up changes will begin integrating
Patcher
into the SCMs and
intorbt patch
andrbt land
.
Unit tests pass.
Summary | ID |
---|---|
01e6e01543afe4fb5ce8d17b129b8202338e6da4 |
Description | From | Last Updated |
---|---|---|
'rbtools.api.resource.Resource' imported but unused Column: 1 Error code: F401 |
reviewbot | |
'rbtools.utils.filesystem.make_tempfile' imported but unused Column: 1 Error code: F401 |
reviewbot | |
'rbtools.utils.filesystem.make_tempfile' imported but unused Column: 1 Error code: F401 |
reviewbot | |
undefined name 'make_tempdir' Column: 23 Error code: F821 |
reviewbot | |
undefined name 'make_tempdir' Column: 23 Error code: F821 |
reviewbot | |
undefined name 'make_tempdir' Column: 23 Error code: F821 |
reviewbot | |
undefined name 'make_tempdir' Column: 23 Error code: F821 |
reviewbot | |
undefined name 'make_tempdir' Column: 23 Error code: F821 |
reviewbot | |
undefined name 'make_tempdir' Column: 23 Error code: F821 |
reviewbot | |
undefined name 'make_tempdir' Column: 23 Error code: F821 |
reviewbot | |
undefined name 'make_tempdir' Column: 23 Error code: F821 |
reviewbot | |
undefined name 'make_tempdir' Column: 23 Error code: F821 |
reviewbot | |
undefined name 'make_tempdir' Column: 23 Error code: F821 |
reviewbot | |
undefined name 'make_tempdir' Column: 23 Error code: F821 |
reviewbot | |
undefined name 'make_tempdir' Column: 23 Error code: F821 |
reviewbot | |
undefined name 'make_tempdir' Column: 23 Error code: F821 |
reviewbot | |
undefined name 'make_tempdir' Column: 23 Error code: F821 |
reviewbot | |
undefined name 'make_tempdir' Column: 23 Error code: F821 |
reviewbot |
- Change Summary:
-
Removed unused imports.
- Commits:
-
Summary ID 0e7015b5503d8d57917cd2356c492395452e0ca1 b3848722303ff5757511497660d9d1530fa25e14