MCPcopy Create free account
hub / github.com/Ishabdullah/Codey-v2 / _generate_diff

Method _generate_diff

core/filesystem.py:414–423  ·  view source on GitHub ↗

Generate unified diff between old and new content.

(self, filename: str, old_lines: List[str], new_lines: List[str])

Source from the content-addressed store, hash-verified

412 raise FilesystemAccessError(f"Failed to list {path}: {e}")
413
414 def _generate_diff(self, filename: str, old_lines: List[str], new_lines: List[str]) -> str:
415 """Generate unified diff between old and new content."""
416 diff = difflib.unified_diff(
417 old_lines,
418 new_lines,
419 fromfile=f"a/{filename}",
420 tofile=f"b/{filename}",
421 n=3
422 )
423 return ''.join(diff)
424
425 def get_last_diff(self) -> Optional[str]:
426 """Get the diff from the last patch operation."""

Callers 1

patchMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected