Skip to main content

Module patch

Module patch 

Source
Expand description

Unified-diff parse and apply (git renames, pure renames, hunk fuzz).

size-waiver: single-domain patch parse + apply + pure renames (#2101). Co-located tests push line count. Policy #1408 — do not split for LOC alone.

Structs§

ApplyHunksOptions
ApplyHunksResult
ConflictRange
Hunk
MergeError
MergeResult
PatchApplyFileResult
PatchFile

Enums§

ApplyHunksStatus
OnStale
PatchLine

Functions§

apply_hunks
apply_hunks_with_options
copy_dest_exists_msg
Error message when a git copy dest already exists.
create_dest_exists_msg
Error message when a patch-create dest already exists.
merge_hunks
parse_diff_file_path
Parse one unified-diff path token (+++ b/foo, rename to "\\056env").
parse_diff_git_paths
Parse diff --git a/old b/new into (old, new) relative paths.
parse_patch
patch_declared_paths
Dest and source paths a unified diff would touch (C-unescaped).
rename_dest_exists_msg
Error message when rename_would_clobber_dest is true.
rename_would_clobber_dest
True when a git rename would overwrite an existing destination that is not a case-only rename of the source (parity with file.rename without force).
unquote_git_c_string
Git C-string unescape for a quoted path body (no surrounding quotes).
unsupported_git_meta_msg
Apply-refuse message for a dest listed from git-meta that we do not write.