darcs-2.18.2: a distributed, interactive, smart revision control system

Safe Haskell | None
Language | Haskell2010

Darcs.Patch

Contents

- for PatchTest

Synopsis

- class PrimPatch (PrimOf p) => PrimPatchBase (p :: Type -> Type -> Type) where
  - type PrimOf (p :: Type -> Type -> Type) :: Type -> Type -> Type
- data Named (p :: Type -> Type -> Type) wX wY
- type family ApplyState (p :: Type -> Type -> Type) :: (Type -> Type) -> Type
- rmfile :: PrimConstruct prim => AnchoredPath -> prim wX wY
- addfile :: PrimConstruct prim => AnchoredPath -> prim wX wY
- rmdir :: PrimConstruct prim => AnchoredPath -> prim wX wY
- adddir :: PrimConstruct prim => AnchoredPath -> prim wX wY
- move :: PrimConstruct prim => AnchoredPath -> AnchoredPath -> prim wX wY
- hunk :: PrimConstruct prim => AnchoredPath -> Int -> [ByteString] -> [ByteString] -> prim wX wY
- tokreplace :: PrimConstruct prim => AnchoredPath -> String -> String -> String -> prim wX wY
- anonymous :: forall (p :: Type -> Type -> Type) wX wY. FromPrim p => FL (PrimOf p) wX wY -> IO (Named p wX wY)
- binary :: PrimConstruct prim => AnchoredPath -> ByteString -> ByteString -> prim wX wY
- description :: ShowPatch p => p wX wY -> Doc
- showPatchWithContext :: (ApplyMonadTrans (ApplyState p) m, ShowContextPatch p) => ShowPatchFor -> ApplyState p m -> p wX wY -> m Doc
- data ShowPatchFor
  - = ForDisplay
  - | ForStorage
- showPatch :: ShowPatchBasic p => ShowPatchFor -> p wX wY -> Doc
- displayPatch :: ShowPatchBasic p => p wX wY -> Doc
- content :: ShowPatch p => p wX wY -> Doc
- infopatch :: forall (p :: Type -> Type -> Type) wX wY. FromPrim p => PatchInfo -> FL (PrimOf p) wX wY -> Named p wX wY
- changepref :: PrimConstruct prim => String -> String -> String -> prim wX wY
- thing :: ShowPatch p => p wX wY -> String
- things :: ShowPatch p => p wX wY -> String
- merge :: Merge p => (p :\/: p) wX wY -> (p :/\: p) wX wY
- commute :: Commute p => (p :> p) wX wY -> Maybe ((p :> p) wX wY)
- listTouchedFiles :: PatchInspect p => p wX wY -> [AnchoredPath]
- hunkMatches :: PatchInspect p => (ByteString -> Bool) -> p wX wY -> Bool
- forceTokReplace :: String -> ByteString -> ByteString -> ByteString -> ByteString
- type PrimPatch (prim :: Type -> Type -> Type) = (Annotate prim, Apply prim, CleanMerge prim, Commute prim, Invert prim, Eq2 prim, IsHunk prim, PatchInspect prim, RepairToFL prim, Show2 prim, PrimConstruct prim, PrimCoalesce prim, PrimDetails prim, PrimApply prim, PrimSift prim, PrimMangleUnravelled prim, ReadPatch prim, ShowPatch prim, ShowContextPatch prim, PatchListFormat prim)
- resolveConflicts :: Conflict p => RL p wO wX -> RL p wX wY -> [ConflictDetails (PrimOf p) wY]
- class Effect (p :: Type -> Type -> Type)
- effect :: Effect p => p wX wY -> FL (PrimOf p) wX wY
- invert :: Invert p => p wX wY -> p wY wX
- invertFL :: forall (p :: Type -> Type -> Type) wX wY. Invert p => FL p wX wY -> RL p wY wX
- invertRL :: forall (p :: Type -> Type -> Type) wX wY. Invert p => RL p wX wY -> FL p wY wX
- commuteFL :: forall (p :: Type -> Type -> Type) wX wY. Commute p => (p :> FL p) wX wY -> Maybe ((FL p :> p) wX wY)
- commuteRL :: forall (p :: Type -> Type -> Type) wX wY. Commute p => (RL p :> p) wX wY -> Maybe ((p :> RL p) wX wY)
- readPatch :: forall (p :: Type -> Type -> Type) wX. ReadPatch p => ByteString -> Either String (Sealed (p wX))
- readPatchPartial :: forall (p :: Type -> Type -> Type) wX. ReadPatch p => ByteString -> Either String (Sealed (p wX), ByteString)
- canonizeFL :: forall (prim :: Type -> Type -> Type) wX wY. (IsHunk prim, PrimCoalesce prim, PrimConstruct prim) => DiffAlgorithm -> FL prim wX wY -> FL prim wX wY
- sortCoalesceFL :: PrimCoalesce prim => FL prim wX wY -> FL prim wX wY
- tryToShrink :: PrimCoalesce prim => FL prim wX wY -> Maybe (FL prim wX wY)
- patchname :: forall (p :: Type -> Type -> Type) wX wY. Named p wX wY -> String
- patchcontents :: forall (p :: Type -> Type -> Type) wX wY. Named p wX wY -> FL p wX wY
- apply :: (Apply p, ApplyMonad (ApplyState p) m) => p wX wY -> m ()
- applyToTree :: (Apply p, MonadThrow m, ApplyState p ~ Tree) => p wX wY -> Tree m -> m (Tree m)
- maybeApplyToTree :: (Apply p, ApplyState p ~ Tree, MonadCatch m) => p wX wY -> Tree m -> m (Maybe (Tree m))
- effectOnPaths :: (Apply p, ApplyState p ~ Tree) => p wX wY -> [AnchoredPath] -> [AnchoredPath]
- patch2patchinfo :: forall (p :: Type -> Type -> Type) wX wY. Named p wX wY -> PatchInfo
- summary :: ShowPatch p => p wX wY -> Doc
- summaryFL :: ShowPatch p => FL p wX wY -> Doc
- plainSummary :: (Summary e, PrimDetails (PrimOf e)) => e wX wY -> Doc
- xmlSummary :: (Summary p, PrimDetails (PrimOf p)) => p wX wY -> Doc
- plainSummaryPrims :: forall (prim :: Type -> Type -> Type) wX wY. PrimDetails prim => Bool -> FL prim wX wY -> Doc
- adddeps :: forall (p :: Type -> Type -> Type) wX wY. Named p wX wY -> [PatchInfo] -> Named p wX wY
- getdeps :: HasDeps p => p wX wY -> [PatchInfo]
- listConflictedFiles :: (Summary p, PatchInspect (PrimOf p)) => p wX wY -> [AnchoredPath]
- isInconsistent :: Check p => p wX wY -> Maybe Doc
- type RepoPatch (p :: Type -> Type -> Type) = (AnnotateRP p, Apply p, ApplyState p ~ ApplyState (PrimOf p), Check p, Commute p, Conflict p, Effect p, Eq2 p, FromPrim p, IsHunk p, IsHunk (PrimOf p), Merge p, PatchInspect p, PatchListFormat p, PrimPatchBase p, ReadPatch p, RepairToFL p, ShowContextPatch p, ShowPatch p, Summary p, ToPrim p, Unwind p)
- type PatchInfoAnd (p :: Type -> Type -> Type) = PatchInfoAndG (Named p)
- hopefully :: PatchInfoAndG p wA wB -> p wA wB
- info :: forall (p :: Type -> Type -> Type) wA wB. PatchInfoAndG p wA wB -> PatchInfo

# Documentation

class PrimPatch (PrimOf p) => PrimPatchBase (p :: Type -> Type -> Type) #

Associated Types

type PrimOf (p :: Type -> Type -> Type) :: Type -> Type -> Type #

#### Instances

Instances details

PrimPatchBase p => PrimPatchBase (Invertible p) # |

Instance details

Defined in Darcs.Patch.Invertible

Associated Types

type PrimOf (Invertible p) |
Instance details Defined in Darcs.Patch.Invertible type PrimOf (Invertible p) = PrimOf p

PrimPatchBase p => PrimPatchBase (Named p) # |

Instance details

Defined in Darcs.Patch.Named

Associated Types

type PrimOf (Named p) |
Instance details Defined in Darcs.Patch.Named type PrimOf (Named p) = PrimOf p

PrimPatchBase p => PrimPatchBase (PatchInfoAndG p) # |

Instance details

Defined in Darcs.Patch.PatchInfoAnd

Associated Types

type PrimOf (PatchInfoAndG p) |
Instance details Defined in Darcs.Patch.PatchInfoAnd type PrimOf (PatchInfoAndG p) = PrimOf p

PrimPatch prim => PrimPatchBase (RebaseChange prim) # |

Instance details

Defined in Darcs.Patch.Rebase.Change

Associated Types

type PrimOf (RebaseChange prim) |
Instance details Defined in Darcs.Patch.Rebase.Change type PrimOf (RebaseChange prim) = prim

PrimPatchBase p => PrimPatchBase (WithDroppedDeps p) # |

Instance details

Defined in Darcs.Patch.Rebase.Change

Associated Types

type PrimOf (WithDroppedDeps p) |
Instance details Defined in Darcs.Patch.Rebase.Change type PrimOf (WithDroppedDeps p) = PrimOf p

PrimPatch prim => PrimPatchBase (RebaseFixup prim) # |

Instance details

Defined in Darcs.Patch.Rebase.Fixup

Associated Types

type PrimOf (RebaseFixup prim) |
Instance details Defined in Darcs.Patch.Rebase.Fixup type PrimOf (RebaseFixup prim) = prim

PrimPatch prim => PrimPatchBase (RepoPatchV1 prim) # |

Instance details

Defined in Darcs.Patch.V1.Core

Associated Types

type PrimOf (RepoPatchV1 prim) |
Instance details Defined in Darcs.Patch.V1.Core type PrimOf (RepoPatchV1 prim) = prim

PrimPatch prim => PrimPatchBase (RepoPatchV2 prim) # |

Instance details

Defined in Darcs.Patch.V2.RepoPatch

Associated Types

type PrimOf (RepoPatchV2 prim) |
Instance details Defined in Darcs.Patch.V2.RepoPatch type PrimOf (RepoPatchV2 prim) = prim

PrimPatchBase p => PrimPatchBase (FL p) # |

Instance details

Defined in Darcs.Patch.FromPrim

Associated Types

type PrimOf (FL p) |
Instance details Defined in Darcs.Patch.FromPrim type PrimOf (FL p) = PrimOf p

PrimPatchBase p => PrimPatchBase (RL p) # |

Instance details

Defined in Darcs.Patch.FromPrim

Associated Types

type PrimOf (RL p) |
Instance details Defined in Darcs.Patch.FromPrim type PrimOf (RL p) = PrimOf p

PrimPatch prim => PrimPatchBase (RepoPatchV3 name prim) # |

Instance details

Defined in Darcs.Patch.V3.Core

Associated Types

type PrimOf (RepoPatchV3 name prim) |
Instance details Defined in Darcs.Patch.V3.Core type PrimOf (RepoPatchV3 name prim) = prim

data Named (p :: Type -> Type -> Type) wX wY #

The `Named` type adds a patch info about a patch, that is a name.

`NamedP info deps p` represents patch `p` with name `info`. `deps` is a list of dependencies added at the named patch level, compared with the unnamed level (ie, dependencies added with `darcs record --ask-deps`).

#### Instances

Instances details

Apply p => Apply (Named p) # |

Instance details

Defined in Darcs.Patch.Named

Associated Types

type ApplyState (Named p) |
Instance details Defined in Darcs.Patch.Named type ApplyState (Named p) = ApplyState p

Methods

apply :: ApplyMonad (ApplyState (Named p)) m => Named p wX wY -> m () #

unapply :: ApplyMonad (ApplyState (Named p)) m => Named p wX wY -> m () #

Commute p => Commute (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods commute :: (Named p :> Named p) wX wY -> Maybe ((Named p :> Named p) wX wY) #

(Commute p, Conflict p, Summary p, PrimPatchBase p, PatchListFormat p, ShowPatch p) => Conflict (Named p) #

This instance takes care of handling the interaction between conflict resolution and explicit dependencies. A conflict involves a set of two or more patches and the general rule is that the conflict is considered resolved if there is another (later) patch that (transitively) depends on each of the (mutually) conflicting patches.

This principle extends to explicit dependencies between `Named` patches. In particular, recording a tag has the effect of resolving any as yet unresolved conflicts in a repo.

In general a `Named` patch contains multiple changes ( a "changeset"). Consider the named patches

      Named A [] a
      Named B [] (b1;b2)
      Named C [] c
      Named D [A,B] _

where, at the RepoPatch level, `a` conflicts with `b1`, and `c` with `b2`. `D` depends explicitly on both `A` and `B`, so it fully covers the conflict between `a` and `b1` and thus we would be justified to consider that particular conflict as resolved. Unfortunately we cannot detect this at the Named patch level because RepoPatchV1 and V2 have no notion of patch identities. Thus, at the Named level the two underlying conflicts appear as a single large conflict between the three named patches `A`, `B`, and `C`, and this means that patch `D` does not count as a (partial) resolution (even though it arguably should).

When we decide that a set of conflicting Named patches is resolved, we move the RepoPatches contained in them to the context of the resolution. For all other named patches, we must commute as much of their contents as possible past the ones marked as resolved, using commutation at the RepoPatch level (i.e. ignoring explicit dependencies).

Instance details Defined in Darcs.Patch.Named Methods isConflicted :: Named p wX wY -> Bool # resolveConflicts :: RL (Named p) wO wX -> RL (Named p) wX wY -> [ConflictDetails (PrimOf (Named p)) wY] #
(Commute p, Conflict p, Summary p, PrimPatchBase p, PatchListFormat p, ShowPatch p) => Conflict (PatchInfoAnd p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods isConflicted :: PatchInfoAnd p wX wY -> Bool # resolveConflicts :: RL (PatchInfoAnd p) wO wX -> RL (PatchInfoAnd p) wX wY -> [ConflictDetails (PrimOf (PatchInfoAnd p)) wY] #
PatchDebug p => PatchDebug (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods patchDebugDummy :: Named p wX wY -> () #
Effect p => Effect (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods effect :: Named p wX wY -> FL (PrimOf (Named p)) wX wY #
IsHunk (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods isHunk :: Named p wX wY -> Maybe (FileHunk (ObjectIdOfPatch (Named p)) wX wY) #
PatchListFormat (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods patchListFormat :: ListFormat (Named p) #
PrimPatchBase p => PrimPatchBase (Named p) # |

Instance details

Defined in Darcs.Patch.Named

Associated Types

type PrimOf (Named p) |
Instance details Defined in Darcs.Patch.Named type PrimOf (Named p) = PrimOf p

Ident (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods ident :: Named p wX wY -> PatchId (Named p) #
PatchInspect p => PatchInspect (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods listTouchedFiles :: Named p wX wY -> [AnchoredPath] # hunkMatches :: (ByteString -> Bool) -> Named p wX wY -> Bool #
CleanMerge p => CleanMerge (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods cleanMerge :: (Named p :\/: Named p) wX wY -> Maybe ((Named p :/\: Named p) wX wY) #
Merge p => Merge (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods merge :: (Named p :\/: Named p) wX wY -> (Named p :/\: Named p) wX wY #
HasDeps (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods getdeps :: Named p wX wY -> [PatchInfo] #
(ReadPatch p, PatchListFormat p) => ReadPatch (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods readPatch' :: Parser (Sealed (Named p wX)) #
Check p => Check (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods isInconsistent :: Named p wX wY -> Maybe Doc #
RepairToFL p => Repair (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods applyAndTryToFix :: ApplyMonad (ApplyState (Named p)) m => Named p wX wY -> m (Maybe (String, Named p wX wY)) #
RepairToFL p => Repair (PatchInfoAnd p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods applyAndTryToFix :: ApplyMonad (ApplyState (PatchInfoAnd p)) m => PatchInfoAnd p wX wY -> m (Maybe (String, PatchInfoAnd p wX wY)) #
(Apply p, IsHunk p, PatchListFormat p, ObjectId (ObjectIdOfPatch p), ShowContextPatch p) => ShowContextPatch (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods showPatchWithContextAndApply :: ApplyMonad (ApplyState (Named p)) m => ShowPatchFor -> Named p wX wY -> m Doc #
(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 #
(PatchListFormat p, ShowPatchBasic p) => ShowPatchBasic (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods showPatch :: ShowPatchFor -> Named p wX wY -> Doc #
Summary p => Summary (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods conflictedEffect :: Named p wX wY -> [IsConflictedPrim (PrimOf (Named p))] #
(PrimPatchBase p, Unwind p) => Unwind (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods fullUnwind :: Named p wX wY -> Unwound (PrimOf (Named p)) wX wY #
(Commute p, Eq2 p) => Eq2 (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods unsafeCompare :: Named p wA wB -> Named p wC wD -> Bool # (=\/=) :: Named p wA wB -> Named p wA wC -> EqCheck wB wC # (=/\=) :: Named p wA wC -> Named p wB wC -> EqCheck wA wB #
Show2 p => Show2 (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods showDict2 :: ShowDict (Named p wX wY) #
Show2 p => Show2 (PatchInfoAnd p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods showDict2 :: ShowDict (PatchInfoAnd p wX wY) #
Show2 p => Show1 (Named p wX) # |
Instance details Defined in Darcs.Patch.Named Methods showDict1 :: Dict (Show (Named p wX wX0)) #
Show2 p => Show1 (PatchInfoAnd p wX) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods showDict1 :: Dict (Show (PatchInfoAnd p wX wX0)) #
Show2 p => Show (Named p wX wY) # |
Instance details Defined in Darcs.Patch.Named Methods showsPrec :: Int -> Named p wX wY -> ShowS # show :: Named p wX wY -> String # showList :: [Named p wX wY] -> ShowS #
type ApplyState (Named p) # |
Instance details Defined in Darcs.Patch.Named type ApplyState (Named p) = ApplyState p
type PrimOf (Named p) # |
Instance details Defined in Darcs.Patch.Named type PrimOf (Named p) = PrimOf p
type PatchId (Named p) # |
Instance details Defined in Darcs.Patch.Named type PatchId (Named p) = PatchInfo

type family ApplyState (p :: Type -> Type -> Type) :: (Type -> Type) -> Type #

#### Instances

Instances details

type ApplyState Prim # |
Instance details Defined in Darcs.Patch.Prim.FileUUID.Apply type ApplyState Prim = ObjectMap
type ApplyState Prim # |
Instance details Defined in Darcs.Patch.Prim.V1.Apply type ApplyState Prim = Tree
type ApplyState Prim # |
Instance details Defined in Darcs.Patch.V1.Prim type ApplyState Prim = ApplyState Prim
type ApplyState Prim # |
Instance details Defined in Darcs.Patch.V2.Prim type ApplyState Prim = ApplyState Prim
type ApplyState (Invertible p) # |
Instance details Defined in Darcs.Patch.Invertible type ApplyState (Invertible p) = ApplyState p
type ApplyState (Named p) # |
Instance details Defined in Darcs.Patch.Named type ApplyState (Named p) = ApplyState p
type ApplyState (PatchInfoAndG p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd type ApplyState (PatchInfoAndG p) = ApplyState p
type ApplyState (RebaseChange prim) # |
Instance details Defined in Darcs.Patch.Rebase.Change type ApplyState (RebaseChange prim) = ApplyState prim
type ApplyState (RebaseFixup prim) # |
Instance details Defined in Darcs.Patch.Rebase.Fixup type ApplyState (RebaseFixup prim) = ApplyState prim
type ApplyState (RepoPatchV1 prim) # |
Instance details Defined in Darcs.Patch.V1.Apply type ApplyState (RepoPatchV1 prim) = ApplyState prim
type ApplyState (RepoPatchV2 prim) # |
Instance details Defined in Darcs.Patch.V2.RepoPatch type ApplyState (RepoPatchV2 prim) = ApplyState prim
type ApplyState (FL p) # |
Instance details Defined in Darcs.Patch.Apply type ApplyState (FL p) = ApplyState p
type ApplyState (RL p) # |
Instance details Defined in Darcs.Patch.Apply type ApplyState (RL p) = ApplyState p
type ApplyState (PrimWithName name p) # |
Instance details Defined in Darcs.Patch.Prim.WithName type ApplyState (PrimWithName name p) = ApplyState p
type ApplyState (RepoPatchV3 name prim) # |
Instance details Defined in Darcs.Patch.V3.Core type ApplyState (RepoPatchV3 name prim) = ApplyState prim
type ApplyState (PatchSeq p) # |
Instance details Defined in Darcs.UI.Commands.Test.Impl type ApplyState (PatchSeq p) = ApplyState p

rmfile :: PrimConstruct prim => AnchoredPath -> prim wX wY #

addfile :: PrimConstruct prim => AnchoredPath -> prim wX wY #

rmdir :: PrimConstruct prim => AnchoredPath -> prim wX wY #

adddir :: PrimConstruct prim => AnchoredPath -> prim wX wY #

move :: PrimConstruct prim => AnchoredPath -> AnchoredPath -> prim wX wY #

hunk :: PrimConstruct prim => AnchoredPath -> Int -> [ByteString] -> [ByteString] -> prim wX wY #

tokreplace :: PrimConstruct prim => AnchoredPath -> String -> String -> String -> prim wX wY #

anonymous :: forall (p :: Type -> Type -> Type) wX wY. FromPrim p => FL (PrimOf p) wX wY -> IO (Named p wX wY) #

binary :: PrimConstruct prim => AnchoredPath -> ByteString -> ByteString -> prim wX wY #

description :: ShowPatch p => p wX wY -> Doc #

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

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

data ShowPatchFor #

Constructors

ForDisplay |
ForStorage |

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

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

content :: ShowPatch p => p wX wY -> Doc #

infopatch :: forall (p :: Type -> Type -> Type) wX wY. FromPrim p => PatchInfo -> FL (PrimOf p) wX wY -> Named p wX wY #

changepref :: PrimConstruct prim => String -> String -> String -> prim wX wY #

thing :: ShowPatch p => p wX wY -> String #

things :: ShowPatch p => p wX wY -> String #

merge :: Merge p => (p :\/: p) wX wY -> (p :/\: p) wX wY #

commute :: Commute p => (p :> p) wX wY -> Maybe ((p :> p) wX wY) #

listTouchedFiles :: PatchInspect p => p wX wY -> [AnchoredPath] #

hunkMatches :: PatchInspect p => (ByteString -> Bool) -> p wX wY -> Bool #

forceTokReplace :: String -> ByteString -> ByteString -> ByteString -> ByteString #

`forceTokReplace tokChars old new input` replaces all occurrences of the `old` token with the `new` one, throughout the `input`.

type PrimPatch (prim :: Type -> Type -> Type) = (Annotate prim, Apply prim, CleanMerge prim, Commute prim, Invert prim, Eq2 prim, IsHunk prim, PatchInspect prim, RepairToFL prim, Show2 prim, PrimConstruct prim, PrimCoalesce prim, PrimDetails prim, PrimApply prim, PrimSift prim, PrimMangleUnravelled prim, ReadPatch prim, ShowPatch prim, ShowContextPatch prim, PatchListFormat prim) #

# for PatchTest

resolveConflicts :: Conflict p => RL p wO wX -> RL p wX wY -> [ConflictDetails (PrimOf p) wY] #

The first parameter is a context containing all patches preceding the ones for which we want to calculate the conflict resolution, which is the second parameter. Each element of the result list represents the resolution of one maximal set of transitively conflicting alternatives, in other words, a connected subset of the conflict graph. But the elements themselves must not conflict with each other, guaranteeing that they can be cleanly merged into a single `FL` of prims.

class Effect (p :: Type -> Type -> Type) #

Patches whose concrete effect can be expressed as a list of primitive patches.

A minimal definition would be either of `effect` or `effectRL`.

Minimal complete definition

effect

#### Instances

Instances details

Effect p => Effect (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods effect :: Named p wX wY -> FL (PrimOf (Named p)) wX wY #
Effect p => Effect (PatchInfoAndG p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods effect :: PatchInfoAndG p wX wY -> FL (PrimOf (PatchInfoAndG p)) wX wY #
Effect p => Effect (WithDroppedDeps p) # |
Instance details Defined in Darcs.Patch.Rebase.Change Methods effect :: WithDroppedDeps p wX wY -> FL (PrimOf (WithDroppedDeps p)) wX wY #
PrimPatch prim => Effect (RepoPatchV1 prim) # |
Instance details Defined in Darcs.Patch.V1.Commute Methods effect :: RepoPatchV1 prim wX wY -> FL (PrimOf (RepoPatchV1 prim)) wX wY #
PrimPatch prim => Effect (RepoPatchV2 prim) # |
Instance details Defined in Darcs.Patch.V2.RepoPatch Methods effect :: RepoPatchV2 prim wX wY -> FL (PrimOf (RepoPatchV2 prim)) wX wY #
Effect p => Effect (FL p) # |
Instance details Defined in Darcs.Patch.Effect Methods effect :: FL p wX wY -> FL (PrimOf (FL p)) wX wY #
Effect p => Effect (RL p) # |
Instance details Defined in Darcs.Patch.Effect Methods effect :: RL p wX wY -> FL (PrimOf (RL p)) wX wY #
Effect (RepoPatchV3 name prim) # |
Instance details Defined in Darcs.Patch.V3.Core Methods effect :: RepoPatchV3 name prim wX wY -> FL (PrimOf (RepoPatchV3 name prim)) wX wY #

effect :: Effect p => p wX wY -> FL (PrimOf p) wX wY #

invert :: Invert p => p wX wY -> p wY wX #

invertFL :: forall (p :: Type -> Type -> Type) wX wY. Invert p => FL p wX wY -> RL p wY wX #

invertRL :: forall (p :: Type -> Type -> Type) wX wY. Invert p => RL p wX wY -> FL p wY wX #

commuteFL :: forall (p :: Type -> Type -> Type) wX wY. Commute p => (p :> FL p) wX wY -> Maybe ((FL p :> p) wX wY) #

`commuteFL` commutes a single element past a FL.

commuteRL :: forall (p :: Type -> Type -> Type) wX wY. Commute p => (RL p :> p) wX wY -> Maybe ((p :> RL p) wX wY) #

`commuteRL` commutes a RL past a single element.

readPatch :: forall (p :: Type -> Type -> Type) wX. ReadPatch p => ByteString -> Either String (Sealed (p wX)) #

readPatchPartial :: forall (p :: Type -> Type -> Type) wX. ReadPatch p => ByteString -> Either String (Sealed (p wX), ByteString) #

canonizeFL :: forall (prim :: Type -> Type -> Type) wX wY. (IsHunk prim, PrimCoalesce prim, PrimConstruct prim) => DiffAlgorithm -> FL prim wX wY -> FL prim wX wY #

Put 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 a diff.

XXX Why not? How does it differ? The implementation for Prim.V1 does sortCoalesceFL and then invokes the diff algorithm for each hunk. How can that be any different to applying the sequence and then taking the diff? Is this merely because diff does not sort by file path?

Besides, diff and apply must be inverses in the sense that for any two states {start, end}, we have

    diff start (apply (diff start end)) == end

sortCoalesceFL :: PrimCoalesce prim => FL prim wX wY -> FL prim wX wY #

This is similar to `tryToShrink` but always gives back a result: if the sequence could not be shrunk we merely give back a sorted version.

This method is included in the class for optimization. Instances are free to use `defaultSortCoalesceFL`.

tryToShrink :: PrimCoalesce prim => FL prim wX wY -> Maybe (FL prim wX wY) #

Try to shrink the input sequence by getting rid of self-cancellations and identity patches or by coalescing patches. Also sort patches according to some internally defined order (specific to the patch type) as far as possible while respecting dependencies. A result of `Nothing` means that we could not shrink the input.

This method is included in the class for optimization. Instances are free to use `defaultTryToShrink`.

patchname :: forall (p :: Type -> Type -> Type) wX wY. Named p wX wY -> String #

patchcontents :: forall (p :: Type -> Type -> Type) wX wY. Named p wX wY -> FL p wX wY #

apply :: (Apply p, ApplyMonad (ApplyState p) m) => p wX wY -> m () #

applyToTree :: (Apply p, MonadThrow m, ApplyState p ~ Tree) => p wX wY -> Tree m -> m (Tree m) #

Apply a patch to a `Tree`, yielding a new `Tree`.

maybeApplyToTree :: (Apply p, ApplyState p ~ Tree, MonadCatch m) => p wX wY -> Tree m -> m (Maybe (Tree m)) #

Attempts to apply a given patch to a Tree. If the apply fails, we return Nothing, otherwise we return the updated Tree.

effectOnPaths :: (Apply p, ApplyState p ~ Tree) => p wX wY -> [AnchoredPath] -> [AnchoredPath] #

patch2patchinfo :: forall (p :: Type -> Type -> Type) wX wY. Named p wX wY -> PatchInfo #

summary :: ShowPatch p => p wX wY -> Doc #

summaryFL :: ShowPatch p => FL p wX wY -> Doc #

plainSummary :: (Summary e, PrimDetails (PrimOf e)) => e wX wY -> Doc #

xmlSummary :: (Summary p, PrimDetails (PrimOf p)) => p wX wY -> Doc #

plainSummaryPrims :: forall (prim :: Type -> Type -> Type) wX wY. PrimDetails prim => Bool -> FL prim wX wY -> Doc #

adddeps :: forall (p :: Type -> Type -> Type) wX wY. Named p wX wY -> [PatchInfo] -> Named p wX wY #

getdeps :: HasDeps p => p wX wY -> [PatchInfo] #

listConflictedFiles :: (Summary p, PatchInspect (PrimOf p)) => p wX wY -> [AnchoredPath] #

isInconsistent :: Check p => p wX wY -> Maybe Doc #

type RepoPatch (p :: Type -> Type -> Type) = (AnnotateRP p, Apply p, ApplyState p ~ ApplyState (PrimOf p), Check p, Commute p, Conflict p, Effect p, Eq2 p, FromPrim p, IsHunk p, IsHunk (PrimOf p), Merge p, PatchInspect p, PatchListFormat p, PrimPatchBase p, ReadPatch p, RepairToFL p, ShowContextPatch p, ShowPatch p, Summary p, ToPrim p, Unwind p) #

type PatchInfoAnd (p :: Type -> Type -> Type) = PatchInfoAndG (Named p) #

hopefully :: PatchInfoAndG p wA wB -> p wA wB #

``hopefully` hp` tries to get a patch from a `PatchInfoAnd` value. If it fails, it outputs an error "failed to read patch: <description of the patch>". We get the description of the patch from the info part of `hp`

info :: forall (p :: Type -> Type -> Type) wA wB. PatchInfoAndG p wA wB -> PatchInfo #