darcs-2.18.1: a distributed, interactive, smart revision control system
Safe HaskellSafe-Inferred
LanguageHaskell2010

Darcs.Patch.Show

Synopsis

Documentation

class ShowPatchBasic p where Source #

Methods

showPatch :: ShowPatchFor -> p wX wY -> Doc Source #

Instances

Instances details
ShowPatchBasic Prim Source # 
Instance details

Defined in Darcs.Patch.Prim.FileUUID.Show

Methods

showPatch :: ShowPatchFor -> Prim wX wY -> Doc Source #

ShowPatchBasic RebaseName Source # 
Instance details

Defined in Darcs.Patch.Rebase.Name

ShowPatchBasic Prim Source # 
Instance details

Defined in Darcs.Patch.V1.Prim

Methods

showPatch :: ShowPatchFor -> Prim wX wY -> Doc Source #

ShowPatchBasic Prim Source # 
Instance details

Defined in Darcs.Patch.V2.Prim

Methods

showPatch :: ShowPatchFor -> Prim wX wY -> Doc Source #

ShowPatchBasic p => ShowPatchBasic (Bracketed p) Source # 
Instance details

Defined in Darcs.Patch.Bracketed

Methods

showPatch :: ShowPatchFor -> Bracketed p wX wY -> Doc Source #

ShowPatchBasic p => ShowPatchBasic (Invertible p) Source # 
Instance details

Defined in Darcs.Patch.Invertible

Methods

showPatch :: ShowPatchFor -> Invertible p wX wY -> Doc Source #

(PatchListFormat p, ShowPatchBasic p) => ShowPatchBasic (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

Methods

showPatch :: ShowPatchFor -> Named p wX wY -> Doc Source #

ShowPatchBasic p => ShowPatchBasic (PatchInfoAndG p) Source # 
Instance details

Defined in Darcs.Patch.PatchInfoAnd

PrimPatch prim => ShowPatchBasic (RebaseChange prim) Source # 
Instance details

Defined in Darcs.Patch.Rebase.Change

Methods

showPatch :: ShowPatchFor -> RebaseChange prim wX wY -> Doc Source #

ShowPatchBasic prim => ShowPatchBasic (RebaseFixup prim) Source # 
Instance details

Defined in Darcs.Patch.Rebase.Fixup

Methods

showPatch :: ShowPatchFor -> RebaseFixup prim wX wY -> Doc Source #

(PatchListFormat prim, ShowPatchBasic prim) => ShowPatchBasic (Unwound prim) Source # 
Instance details

Defined in Darcs.Patch.Unwind

Methods

showPatch :: ShowPatchFor -> Unwound prim wX wY -> Doc Source #

ShowPatchBasic prim => ShowPatchBasic (RepoPatchV1 prim) Source # 
Instance details

Defined in Darcs.Patch.V1.Show

Methods

showPatch :: ShowPatchFor -> RepoPatchV1 prim wX wY -> Doc Source #

PrimPatch prim => ShowPatchBasic (RepoPatchV2 prim) Source # 
Instance details

Defined in Darcs.Patch.V2.RepoPatch

Methods

showPatch :: ShowPatchFor -> RepoPatchV2 prim wX wY -> Doc Source #

(PatchListFormat p, ShowPatchBasic p) => ShowPatchBasic (FL p) Source # 
Instance details

Defined in Darcs.Patch.Viewing

Methods

showPatch :: ShowPatchFor -> FL p wX wY -> Doc Source #

(PatchListFormat p, ShowPatchBasic p) => ShowPatchBasic (RL p) Source # 
Instance details

Defined in Darcs.Patch.Viewing

Methods

showPatch :: ShowPatchFor -> RL p wX wY -> Doc Source #

(StorableId name, ShowPatchBasic p) => ShowPatchBasic (PrimWithName name p) Source # 
Instance details

Defined in Darcs.Patch.Prim.WithName

Methods

showPatch :: ShowPatchFor -> PrimWithName name p wX wY -> Doc Source #

(SignedId name, StorableId name, PrimPatch prim) => ShowPatchBasic (RepoPatchV3 name prim) Source # 
Instance details

Defined in Darcs.Patch.V3.Core

Methods

showPatch :: ShowPatchFor -> RepoPatchV3 name prim wX wY -> Doc Source #

class ShowPatchBasic p => ShowPatch p where Source #

This class is used only for user interaction, not for storage. The default implementations for description and content are suitable only for PrimPatch and RepoPatch types. Logically, description should default to mempty while content should default to displayPatch. We define them the other way around so that showFriendly gives reasonable results for all patch types.

Minimal complete definition

summary

Methods

content :: p wX wY -> Doc Source #

description :: p wX wY -> Doc Source #

summary :: p wX wY -> Doc Source #

summaryFL :: FL p wX wY -> Doc Source #

thing :: p wX wY -> String Source #

things :: p wX wY -> String Source #

Instances

Instances details
ShowPatch Prim Source # 
Instance details

Defined in Darcs.Patch.Prim.FileUUID.Show

Methods

content :: Prim wX wY -> Doc Source #

description :: Prim wX wY -> Doc Source #

summary :: Prim wX wY -> Doc Source #

summaryFL :: FL Prim wX wY -> Doc Source #

thing :: Prim wX wY -> String Source #

things :: Prim wX wY -> String Source #

ShowPatch RebaseName Source # 
Instance details

Defined in Darcs.Patch.Rebase.Name

ShowPatch Prim Source # 
Instance details

Defined in Darcs.Patch.V1.Prim

Methods

content :: Prim wX wY -> Doc Source #

description :: Prim wX wY -> Doc Source #

summary :: Prim wX wY -> Doc Source #

summaryFL :: FL Prim wX wY -> Doc Source #

thing :: Prim wX wY -> String Source #

things :: Prim wX wY -> String Source #

ShowPatch Prim Source # 
Instance details

Defined in Darcs.Patch.V2.Prim

Methods

content :: Prim wX wY -> Doc Source #

description :: Prim wX wY -> Doc Source #

summary :: Prim wX wY -> Doc Source #

summaryFL :: FL Prim wX wY -> Doc Source #

thing :: Prim wX wY -> String Source #

things :: Prim wX wY -> String Source #

ShowPatch p => ShowPatch (Invertible p) Source # 
Instance details

Defined in Darcs.Patch.Invertible

Methods

content :: Invertible p wX wY -> Doc Source #

description :: Invertible p wX wY -> Doc Source #

summary :: Invertible p wX wY -> Doc Source #

summaryFL :: FL (Invertible p) wX wY -> Doc Source #

thing :: Invertible p wX wY -> String Source #

things :: Invertible p wX wY -> String Source #

(Summary p, PatchListFormat p, PrimPatchBase p, ShowPatch p) => ShowPatch (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

Methods

content :: Named p wX wY -> Doc Source #

description :: Named p wX wY -> Doc Source #

summary :: Named p wX wY -> Doc Source #

summaryFL :: FL (Named p) wX wY -> Doc Source #

thing :: Named p wX wY -> String Source #

things :: Named p wX wY -> String Source #

(Summary p, PatchListFormat p, ShowPatch p) => ShowPatch (PatchInfoAndG p) Source # 
Instance details

Defined in Darcs.Patch.PatchInfoAnd

PrimPatch prim => ShowPatch (RebaseChange prim) Source # 
Instance details

Defined in Darcs.Patch.Rebase.Change

Methods

content :: RebaseChange prim wX wY -> Doc Source #

description :: RebaseChange prim wX wY -> Doc Source #

summary :: RebaseChange prim wX wY -> Doc Source #

summaryFL :: FL (RebaseChange prim) wX wY -> Doc Source #

thing :: RebaseChange prim wX wY -> String Source #

things :: RebaseChange prim wX wY -> String Source #

PrimPatch prim => ShowPatch (RepoPatchV1 prim) Source # 
Instance details

Defined in Darcs.Patch.V1.Viewing

Methods

content :: RepoPatchV1 prim wX wY -> Doc Source #

description :: RepoPatchV1 prim wX wY -> Doc Source #

summary :: RepoPatchV1 prim wX wY -> Doc Source #

summaryFL :: FL (RepoPatchV1 prim) wX wY -> Doc Source #

thing :: RepoPatchV1 prim wX wY -> String Source #

things :: RepoPatchV1 prim wX wY -> String Source #

PrimPatch prim => ShowPatch (RepoPatchV2 prim) Source # 
Instance details

Defined in Darcs.Patch.V2.RepoPatch

Methods

content :: RepoPatchV2 prim wX wY -> Doc Source #

description :: RepoPatchV2 prim wX wY -> Doc Source #

summary :: RepoPatchV2 prim wX wY -> Doc Source #

summaryFL :: FL (RepoPatchV2 prim) wX wY -> Doc Source #

thing :: RepoPatchV2 prim wX wY -> String Source #

things :: RepoPatchV2 prim wX wY -> String Source #

(PatchListFormat p, ShowPatch p) => ShowPatch (FL p) Source # 
Instance details

Defined in Darcs.Patch.Viewing

Methods

content :: FL p wX wY -> Doc Source #

description :: FL p wX wY -> Doc Source #

summary :: FL p wX wY -> Doc Source #

summaryFL :: FL (FL p) wX wY -> Doc Source #

thing :: FL p wX wY -> String Source #

things :: FL p wX wY -> String Source #

(PatchListFormat p, ShowPatch p) => ShowPatch (RL p) Source # 
Instance details

Defined in Darcs.Patch.Viewing

Methods

content :: RL p wX wY -> Doc Source #

description :: RL p wX wY -> Doc Source #

summary :: RL p wX wY -> Doc Source #

summaryFL :: FL (RL p) wX wY -> Doc Source #

thing :: RL p wX wY -> String Source #

things :: RL p wX wY -> String Source #

(StorableId name, PrimDetails p, ShowPatchBasic p) => ShowPatch (PrimWithName name p) Source # 
Instance details

Defined in Darcs.Patch.Prim.WithName

Methods

content :: PrimWithName name p wX wY -> Doc Source #

description :: PrimWithName name p wX wY -> Doc Source #

summary :: PrimWithName name p wX wY -> Doc Source #

summaryFL :: FL (PrimWithName name p) wX wY -> Doc Source #

thing :: PrimWithName name p wX wY -> String Source #

things :: PrimWithName name p wX wY -> String Source #

(SignedId name, StorableId name, PrimPatch prim) => ShowPatch (RepoPatchV3 name prim) Source # 
Instance details

Defined in Darcs.Patch.V3.Core

Methods

content :: RepoPatchV3 name prim wX wY -> Doc Source #

description :: RepoPatchV3 name prim wX wY -> Doc Source #

summary :: RepoPatchV3 name prim wX wY -> Doc Source #

summaryFL :: FL (RepoPatchV3 name prim) wX wY -> Doc Source #

thing :: RepoPatchV3 name prim wX wY -> String Source #

things :: RepoPatchV3 name prim wX wY -> String Source #

class ShowPatchBasic p => ShowContextPatch p where Source #

Methods

showPatchWithContextAndApply :: ApplyMonad (ApplyState p) m => ShowPatchFor -> p wX wY -> m Doc Source #

Show a patch with context lines added, as diff -u does. Thus, it differs from showPatch only for hunks. It is used for instance before putting it into a bundle. As this unified context is not included in patch representation, this requires access to the ApplyState.

Note that this applies the patch in the ApplyMonad given by the context. This is done in order to simplify showing multiple patches in a series, since each patch may change the context lines for later changes.

For a version that does not apply the patch see showPatchWithContext.

Instances

Instances details
Apply Prim => ShowContextPatch Prim Source # 
Instance details

Defined in Darcs.Patch.Prim.FileUUID.Show

ShowContextPatch Prim Source # 
Instance details

Defined in Darcs.Patch.V1.Prim

ShowContextPatch Prim Source # 
Instance details

Defined in Darcs.Patch.V2.Prim

ShowContextPatch p => ShowContextPatch (Invertible p) Source # 
Instance details

Defined in Darcs.Patch.Invertible

(Apply p, IsHunk p, PatchListFormat p, ObjectId (ObjectIdOfPatch p), ShowContextPatch p) => ShowContextPatch (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

ShowContextPatch p => ShowContextPatch (PatchInfoAndG p) Source # 
Instance details

Defined in Darcs.Patch.PatchInfoAnd

PrimPatch prim => ShowContextPatch (RebaseChange prim) Source # 
Instance details

Defined in Darcs.Patch.Rebase.Change

PrimPatch prim => ShowContextPatch (RepoPatchV1 prim) Source # 
Instance details

Defined in Darcs.Patch.V1.Viewing

PrimPatch prim => ShowContextPatch (RepoPatchV2 prim) Source # 
Instance details

Defined in Darcs.Patch.V2.RepoPatch

(Apply p, IsHunk p, PatchListFormat p, ShowContextPatch p, ObjectId (ObjectIdOfPatch p)) => ShowContextPatch (FL p) Source # 
Instance details

Defined in Darcs.Patch.Viewing

(ShowContextPatch p, Apply p, IsHunk p, PatchListFormat p, ObjectId (ObjectIdOfPatch p)) => ShowContextPatch (RL p) Source # 
Instance details

Defined in Darcs.Patch.Viewing

(StorableId name, ShowContextPatch p) => ShowContextPatch (PrimWithName name p) Source # 
Instance details

Defined in Darcs.Patch.Prim.WithName

(SignedId name, StorableId name, PrimPatch prim) => ShowContextPatch (RepoPatchV3 name prim) Source # 
Instance details

Defined in Darcs.Patch.V3.Core

showPatchWithContext :: (ApplyMonadTrans (ApplyState p) m, ShowContextPatch p) => ShowPatchFor -> ApplyState p m -> p wX wY -> m Doc Source #

Like showPatchWithContextAndApply but without applying the patch in the monad m.

formatFileName :: FileNameFormat -> AnchoredPath -> Doc Source #

Format a AnchoredPath to a Doc according to the given FileNameFormat.

NOTE: This is not only used for display but also to format patch files. This is why we have to do the white space encoding here. See writePatchIfNecessary.

Besides white space encoding, for FileNameFormatV2 we just pack it into a Doc. For FileNameFormatV1 we must emulate the non-standard darcs-1 encoding of file paths: it is an UTF8 encoding of the raw byte stream, interpreted as code points.

See also readFileName.