pub fn patch(cfg: &Config, opts: PatchOpts) -> Result<PatchReport, PkgError>Expand description
Create (or, with force, rebuild) the patch_dir of one dep from the
commit its pin resolves to, and record that commit as patch_base in
the lockfile.
The whole package root is copied, so types/ and other siblings of the
entry come along. From then on install resolves the dep from the
patch for as long as the pin keeps resolving to patch_base; edit the
files in place and commit them with the project. When the pin moves,
install falls back to upstream with a warning, and patch --force
rebuilds the directory from the new commit (discarding local edits —
re-apply them from your VCS history).
§Errors
PkgError::UnknownDepwhennameis not in[deps].PkgError::Validationwhen the dep has nopatch_dir, or the directory exists andforceis not set.PkgError::Fetchwrapping the fetcher error.PkgError::Iofor the copy / lockfile write.