(self, operation: ApplyPatchOperation)
| 46 | return ApplyPatchResult(output=f"Created {relative}") |
| 47 | |
| 48 | def update_file(self, operation: ApplyPatchOperation) -> ApplyPatchResult: |
| 49 | relative = self._relative_path(operation.path) |
| 50 | self._require_approval(operation, relative) |
| 51 | target = self._resolve(operation.path) |
| 52 | original = target.read_text(encoding="utf-8") |
| 53 | diff = operation.diff or "" |
| 54 | patched = apply_diff(original, diff) |
| 55 | target.write_text(patched, encoding="utf-8") |
| 56 | return ApplyPatchResult(output=f"Updated {relative}") |
| 57 | |
| 58 | def delete_file(self, operation: ApplyPatchOperation) -> ApplyPatchResult: |
| 59 | relative = self._relative_path(operation.path) |
nothing calls this directly
no test coverage detected