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

Darcs.Patch.Show

Synopsis

Documentation

class ShowPatchBasic p where #

Methods

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

Instances

Instances details
ShowPatchBasic Prim # 
Instance details

Defined in Darcs.Patch.Prim.FileUUID.Show

Methods

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

ShowPatchBasic RebaseName # 
Instance details

Defined in Darcs.Patch.Rebase.Name

Methods

showPatch :: ShowPatchFor -> RebaseName wX wY -> Doc #

ShowPatchBasic Prim # 
Instance details

Defined in Darcs.Patch.V1.Prim

Methods

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

ShowPatchBasic Prim # 
Instance details

Defined in Darcs.Patch.V2.Prim

Methods

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

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

Defined in Darcs.Patch.Bracketed

Methods

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

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

Defined in Darcs.Patch.Invertible

Methods

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

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

Defined in Darcs.Patch.Named

Methods

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

(ShowPatchBasic prim, Invert prim, PatchListFormat prim) => ShowPatchBasic (RebaseChange prim) # 
Instance details

Defined in Darcs.Patch.Rebase.Change

Methods

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

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

Defined in Darcs.Patch.Rebase.Fixup

Methods

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

(PrimPatchBase p, PatchListFormat p, ShowPatchBasic p) => ShowPatchBasic (Suspended p) # 
Instance details

Defined in Darcs.Patch.Rebase.Suspended

Methods

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

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

Defined in Darcs.Patch.Unwind

Methods

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

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

Defined in Darcs.Patch.V1.Show

Methods

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

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

Defined in Darcs.Patch.V2.RepoPatch

Methods

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

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

Defined in Darcs.Patch.Viewing

Methods

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

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

Defined in Darcs.Patch.Viewing

Methods

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

(ShowPatchBasic p, PatchListFormat p) => ShowPatchBasic (WrappedNamed rt p) # 
Instance details

Defined in Darcs.Patch.Named.Wrapped

Methods

showPatch :: ShowPatchFor -> WrappedNamed rt p wX wY -> Doc #

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

Defined in Darcs.Patch.PatchInfoAnd

Methods

showPatch :: ShowPatchFor -> PatchInfoAndG rt p wX wY -> Doc #

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

Defined in Darcs.Patch.Prim.WithName

Methods

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

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

Defined in Darcs.Patch.V3.Core

Methods

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

displayPatch :: ShowPatchBasic p => p wX wY -> Doc #

data ShowPatchFor #

Constructors

ForDisplay 
ForStorage 

class ShowPatchBasic p => ShowPatch p where #

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 #

description :: p wX wY -> Doc #

summary :: p wX wY -> Doc #

summaryFL :: FL p wX wY -> Doc #

thing :: p wX wY -> String #

things :: p wX wY -> String #

Instances

Instances details
ShowPatch Prim # 
Instance details

Defined in Darcs.Patch.Prim.FileUUID.Show

Methods

content :: Prim wX wY -> Doc #

description :: Prim wX wY -> Doc #

summary :: Prim wX wY -> Doc #

summaryFL :: FL Prim wX wY -> Doc #

thing :: Prim wX wY -> String #

things :: Prim wX wY -> String #

ShowPatch RebaseName # 
Instance details

Defined in Darcs.Patch.Rebase.Name

Methods

content :: RebaseName wX wY -> Doc #

description :: RebaseName wX wY -> Doc #

summary :: RebaseName wX wY -> Doc #

summaryFL :: FL RebaseName wX wY -> Doc #

thing :: RebaseName wX wY -> String #

things :: RebaseName wX wY -> String #

ShowPatch Prim # 
Instance details

Defined in Darcs.Patch.V1.Prim

Methods

content :: Prim wX wY -> Doc #

description :: Prim wX wY -> Doc #

summary :: Prim wX wY -> Doc #

summaryFL :: FL Prim wX wY -> Doc #

thing :: Prim wX wY -> String #

things :: Prim wX wY -> String #

ShowPatch Prim # 
Instance details

Defined in Darcs.Patch.V2.Prim

Methods

content :: Prim wX wY -> Doc #

description :: Prim wX wY -> Doc #

summary :: Prim wX wY -> Doc #

summaryFL :: FL Prim wX wY -> Doc #

thing :: Prim wX wY -> String #

things :: Prim wX wY -> String #

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

Defined in Darcs.Patch.Invertible

Methods

content :: Invertible p wX wY -> Doc #

description :: Invertible p wX wY -> Doc #

summary :: Invertible p wX wY -> Doc #

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

thing :: Invertible p wX wY -> String #

things :: Invertible p wX wY -> String #

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

Defined in Darcs.Patch.Named

Methods

content :: Named p wX wY -> Doc #

description :: Named p wX wY -> Doc #

summary :: Named p wX wY -> Doc #

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

thing :: Named p wX wY -> String #

things :: Named p wX wY -> String #

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

Defined in Darcs.Patch.Rebase.Change

Methods

content :: RebaseChange prim wX wY -> Doc #

description :: RebaseChange prim wX wY -> Doc #

summary :: RebaseChange prim wX wY -> Doc #

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

thing :: RebaseChange prim wX wY -> String #

things :: RebaseChange prim wX wY -> String #

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

Defined in Darcs.Patch.V1.Viewing

Methods

content :: RepoPatchV1 prim wX wY -> Doc #

description :: RepoPatchV1 prim wX wY -> Doc #

summary :: RepoPatchV1 prim wX wY -> Doc #

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

thing :: RepoPatchV1 prim wX wY -> String #

things :: RepoPatchV1 prim wX wY -> String #

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

Defined in Darcs.Patch.V2.RepoPatch

Methods

content :: RepoPatchV2 prim wX wY -> Doc #

description :: RepoPatchV2 prim wX wY -> Doc #

summary :: RepoPatchV2 prim wX wY -> Doc #

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

thing :: RepoPatchV2 prim wX wY -> String #

things :: RepoPatchV2 prim wX wY -> String #

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

Defined in Darcs.Patch.Viewing

Methods

content :: FL p wX wY -> Doc #

description :: FL p wX wY -> Doc #

summary :: FL p wX wY -> Doc #

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

thing :: FL p wX wY -> String #

things :: FL p wX wY -> String #

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

Defined in Darcs.Patch.Viewing

Methods

content :: RL p wX wY -> Doc #

description :: RL p wX wY -> Doc #

summary :: RL p wX wY -> Doc #

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

thing :: RL p wX wY -> String #

things :: RL p wX wY -> String #

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

Defined in Darcs.Patch.PatchInfoAnd

Methods

content :: PatchInfoAndG rt p wX wY -> Doc #

description :: PatchInfoAndG rt p wX wY -> Doc #

summary :: PatchInfoAndG rt p wX wY -> Doc #

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

thing :: PatchInfoAndG rt p wX wY -> String #

things :: PatchInfoAndG rt p wX wY -> String #

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

Defined in Darcs.Patch.Prim.WithName

Methods

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

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

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

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

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

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

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

Defined in Darcs.Patch.V3.Core

Methods

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

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

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

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

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

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

class ShowPatchBasic p => ShowContextPatch p where #

Methods

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

showContextPatch is used to add context to a patch, 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 tree.

Instances

Instances details
ShowContextPatch Prim # 
Instance details

Defined in Darcs.Patch.Prim.FileUUID.Show

ShowContextPatch Prim # 
Instance details

Defined in Darcs.Patch.V1.Prim

ShowContextPatch Prim # 
Instance details

Defined in Darcs.Patch.V2.Prim

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

Defined in Darcs.Patch.Invertible

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

Defined in Darcs.Patch.Named

Methods

showContextPatch :: ApplyMonad (ApplyState (Named p)) m => ShowPatchFor -> Named p wX wY -> m Doc #

(ShowPatchBasic prim, Invert prim, PatchListFormat prim) => ShowContextPatch (RebaseChange prim) # 
Instance details

Defined in Darcs.Patch.Rebase.Change

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

Defined in Darcs.Patch.V1.Viewing

Methods

showContextPatch :: ApplyMonad (ApplyState (RepoPatchV1 prim)) m => ShowPatchFor -> RepoPatchV1 prim wX wY -> m Doc #

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

Defined in Darcs.Patch.V2.RepoPatch

Methods

showContextPatch :: ApplyMonad (ApplyState (RepoPatchV2 prim)) m => ShowPatchFor -> RepoPatchV2 prim wX wY -> m Doc #

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

Defined in Darcs.Patch.Viewing

Methods

showContextPatch :: ApplyMonad (ApplyState (FL p)) m => ShowPatchFor -> FL p wX wY -> m Doc #

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

Defined in Darcs.Patch.Viewing

Methods

showContextPatch :: ApplyMonad (ApplyState (RL p)) m => ShowPatchFor -> RL p wX wY -> m Doc #

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

Defined in Darcs.Patch.PatchInfoAnd

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

Defined in Darcs.Patch.Prim.WithName

Methods

showContextPatch :: ApplyMonad (ApplyState (PrimWithName name p)) m => ShowPatchFor -> PrimWithName name p wX wY -> m Doc #

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

Defined in Darcs.Patch.V3.Core

Methods

showContextPatch :: ApplyMonad (ApplyState (RepoPatchV3 name prim)) m => ShowPatchFor -> RepoPatchV3 name prim wX wY -> m Doc #

formatFileName :: FileNameFormat -> AnchoredPath -> Doc #

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.