ps coalesces as many patches in
possible, sorting the results in some standard order.
It can sometimes be handy to have a canonical representation of a given
patch. We achieve this by defining a canonical form for each patch type,
and a function
canonize which takes a patch and puts it into
canonical form. This routine is used by the diff function to create an
optimal patch (based on an LCS algorithm) from a simple hunk describing the
old and new version of a file.
ps puts a sequence of primitive patches into
canonical form. Even if the patches are just hunk patches,
this is not necessarily the same set of results as you would get
if you applied the sequence to a specific tree and recalculated
Note that this process does not preserve the commutation behaviour of the patches and is therefore not appropriate for use when working with already recorded patches (unless doing amend-record or the like).
class (Patchy prim, PatchListFormat prim, IsHunk prim, RepairToFL prim, PrimConstruct prim, PrimCanonize prim, PrimClassify prim, PrimDetails prim, PrimShow prim, PrimRead prim, PrimApply prim) => PrimPatch prim Source
|PrimPatchBase p => PrimPatchBase (RL p)|
|PrimPatchBase p => PrimPatchBase (FL p)|
|PrimPatch prim => PrimPatchBase (Patch prim)|
|PrimPatchBase p => PrimPatchBase (Named p)|
|PrimPatchBase p => PrimPatchBase (PatchInfoAnd p)|
|PrimPatch prim => PrimPatchBase (RealPatch prim)|