MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / CreateReversePatch

Function CreateReversePatch

internal/diff/diff.go:55–57  ·  view source on GitHub ↗

CreateReversePatch computes a patch that transforms newText back into oldText. Used for reverse-diff version storage: current doc has latest content, versions store patches to go backwards.

(oldText, newText string)

Source from the content-addressed store, hash-verified

53// Used for reverse-diff version storage: current doc has latest content,
54// versions store patches to go backwards.
55func CreateReversePatch(oldText, newText string) string {
56 return CreatePatch(newText, oldText)
57}
58
59// FormatDiffSummary returns a human-readable summary of changes.
60func FormatDiffSummary(oldText, newText string) string {

Callers 4

UpdateDocumentMethod · 0.92
TestReversePatchFunction · 0.85

Calls 1

CreatePatchFunction · 0.85

Tested by 2

TestReversePatchFunction · 0.68