MCPcopy Create free account
hub / github.com/ScaleML/AgentSPEX / PatchHunk

Class PatchHunk

src/sandbox_vm/tools/code/patch.py:36–49  ·  view source on GitHub ↗

Represents a single change block in a patch.

Source from the content-addressed store, hash-verified

34
35
36class PatchHunk:
37 """Represents a single change block in a patch."""
38
39 def __init__(self):
40 self.operation: str = "Update" # Update, Add, Delete
41 self.filepath: str = ""
42 self.search_hint: str = "" # Text from @@ line
43 self.context_before: List[str] = []
44 self.old_lines: List[str] = []
45 self.new_lines: List[str] = []
46 self.context_after: List[str] = []
47
48 def __repr__(self):
49 return f"PatchHunk(op={self.operation}, file={self.filepath}, old={len(self.old_lines)}, new={len(self.new_lines)})"
50
51
52class MatchResult:

Callers 1

_parse_patch_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected