patchutils

package
v0.0.0-...-1834054 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyOptions

type ApplyOptions struct {
	CreateBackup     bool
	BackupSuffix     string
	DryRun           bool
	IgnoreWhitespace bool
}

ApplyOptions configures patch application behavior

func DefaultApplyOptions

func DefaultApplyOptions() ApplyOptions

DefaultApplyOptions returns sensible defaults for patch application

type ApplyResult

type ApplyResult struct {
	FilePath     string `json:"file_path"`
	Success      bool   `json:"success"`
	Error        string `json:"error,omitempty"`
	BackupPath   string `json:"backup_path,omitempty"`
	HunksApplied int    `json:"hunks_applied"`
	LinesChanged int    `json:"lines_changed"`
	OriginalSize int    `json:"original_size"`
	NewSize      int    `json:"new_size"`
}

ApplyResult contains information about the patch application

type PatchApplier

type PatchApplier struct {
	// contains filtered or unexported fields
}

PatchApplier handles applying patches to files

func NewPatchApplier

func NewPatchApplier(workspaceRoot string, options ApplyOptions) *PatchApplier

NewPatchApplier creates a new patch applier

func (*PatchApplier) ApplyMultiplePatches

func (pa *PatchApplier) ApplyMultiplePatches(patches map[string]string) ([]ApplyResult, error)

ApplyMultiplePatches applies multiple patches with rollback on failure

func (*PatchApplier) ApplyPatch

func (pa *PatchApplier) ApplyPatch(filePath, patchContent string) (*ApplyResult, error)

ApplyPatch applies a unified diff patch to a file

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL