Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data RepoType
- class IsRepoType (rt :: RepoType)
- class PrimPatch (PrimOf p) => PrimPatchBase p where
- type PrimOf (p :: * -> * -> *) :: * -> * -> *
- data Named p wX wY
- type family 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 :: 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
- showContextPatch :: (ShowContextPatch p, ApplyMonad (ApplyState p) m) => ShowPatchFor -> p wX wY -> m Doc
- data ShowPatchFor
- 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 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
- primIsAddfile :: PrimClassify prim => prim wX wY -> Bool
- primIsHunk :: PrimClassify prim => prim wX wY -> Bool
- primIsSetpref :: PrimClassify prim => prim wX wY -> Bool
- 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 = (Apply prim, CleanMerge prim, Commute prim, Invert prim, Eq2 prim, IsHunk prim, PatchInspect prim, RepairToFL prim, Show2 prim, PrimConstruct prim, PrimCanonize prim, PrimClassify 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
- effect :: Effect p => p wX wY -> FL (PrimOf p) wX wY
- primIsBinary :: PrimClassify prim => prim wX wY -> Bool
- primIsAdddir :: PrimClassify prim => prim wX wY -> Bool
- invert :: Invert p => p wX wY -> p wY wX
- invertFL :: Invert p => FL p wX wY -> RL p wY wX
- invertRL :: Invert p => RL p wX wY -> FL p wY wX
- dropInverses :: (Invert p, Eq2 p) => FL p wX wY -> Maybe (FL p wX wY)
- commuteFL :: Commute p => (p :> FL p) wX wY -> Maybe ((FL p :> p) wX wY)
- commuteRL :: Commute p => (RL p :> p) wX wY -> Maybe ((p :> RL p) wX wY)
- readPatch :: ReadPatch p => ByteString -> Either String (Sealed (p wX))
- readPatchPartial :: ReadPatch p => ByteString -> Either String (Sealed (p wX), ByteString)
- canonize :: PrimCanonize prim => DiffAlgorithm -> prim wX wY -> FL prim wX wY
- sortCoalesceFL :: PrimCanonize prim => FL prim wX wY -> FL prim wX wY
- tryToShrink :: PrimCanonize prim => FL prim wX wY -> FL prim wX wY
- patchname :: Named p wX wY -> String
- patchcontents :: Named p wX wY -> FL p wX wY
- apply :: (Apply p, ApplyMonad (ApplyState p) m) => p wX wY -> m ()
- applyToTree :: (Apply p, Monad m, ApplyState p ~ Tree) => p wX wY -> Tree m -> m (Tree m)
- maybeApplyToTree :: (Apply p, ApplyState p ~ Tree) => p wX wY -> Tree IO -> IO (Maybe (Tree IO))
- effectOnPaths :: (Apply p, ApplyState p ~ Tree) => p wX wY -> [AnchoredPath] -> [AnchoredPath]
- patch2patchinfo :: 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 :: PrimDetails prim => Bool -> FL prim wX wY -> Doc
- adddeps :: 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 = (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)
Documentation
This type is intended to be used as a phantom type via the DataKinds
extension. It tracks different types of repositories, e.g. to
indicate when a rebase is in progress.
class IsRepoType (rt :: RepoType) Source #
Instances
IsRebaseType rebaseType => IsRepoType (RepoType rebaseType) Source # | |
Defined in Darcs.Patch.RepoType singletonRepoType :: SRepoType (RepoType rebaseType) Source # |
class PrimPatch (PrimOf p) => PrimPatchBase p Source #
Instances
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
type family ApplyState p :: (* -> *) -> * Source #
Instances
rmfile :: PrimConstruct prim => AnchoredPath -> prim wX wY Source #
addfile :: PrimConstruct prim => AnchoredPath -> prim wX wY Source #
rmdir :: PrimConstruct prim => AnchoredPath -> prim wX wY Source #
adddir :: PrimConstruct prim => AnchoredPath -> prim wX wY Source #
move :: PrimConstruct prim => AnchoredPath -> AnchoredPath -> prim wX wY Source #
hunk :: PrimConstruct prim => AnchoredPath -> Int -> [ByteString] -> [ByteString] -> prim wX wY Source #
tokreplace :: PrimConstruct prim => AnchoredPath -> String -> String -> String -> prim wX wY Source #
binary :: PrimConstruct prim => AnchoredPath -> ByteString -> ByteString -> prim wX wY Source #
description :: ShowPatch p => p wX wY -> Doc Source #
showContextPatch :: (ShowContextPatch p, ApplyMonad (ApplyState p) m) => ShowPatchFor -> p wX wY -> m Doc Source #
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.
showPatch :: ShowPatchBasic p => ShowPatchFor -> p wX wY -> Doc Source #
displayPatch :: ShowPatchBasic p => p wX wY -> Doc Source #
infopatch :: forall p wX wY. FromPrim p => PatchInfo -> FL (PrimOf p) wX wY -> Named p wX wY Source #
changepref :: PrimConstruct prim => String -> String -> String -> prim wX wY Source #
primIsAddfile :: PrimClassify prim => prim wX wY -> Bool Source #
primIsHunk :: PrimClassify prim => prim wX wY -> Bool Source #
primIsSetpref :: PrimClassify prim => prim wX wY -> Bool Source #
listTouchedFiles :: PatchInspect p => p wX wY -> [AnchoredPath] Source #
hunkMatches :: PatchInspect p => (ByteString -> Bool) -> p wX wY -> Bool Source #
forceTokReplace :: String -> ByteString -> ByteString -> ByteString -> ByteString Source #
forceTokReplace tokChars old new input
replaces all occurrences of
the old
token with the new
one, throughout the input
.
type PrimPatch prim = (Apply prim, CleanMerge prim, Commute prim, Invert prim, Eq2 prim, IsHunk prim, PatchInspect prim, RepairToFL prim, Show2 prim, PrimConstruct prim, PrimCanonize prim, PrimClassify prim, PrimDetails prim, PrimApply prim, PrimSift prim, PrimMangleUnravelled prim, ReadPatch prim, ShowPatch prim, ShowContextPatch prim, PatchListFormat prim) Source #
for PatchTest
resolveConflicts :: Conflict p => RL p wO wX -> RL p wX wY -> [ConflictDetails (PrimOf p) wY] Source #
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.
Patches whose concrete effect can be expressed as a list of primitive patches.
A minimal definition would be either of effect
or effectRL
.
Instances
Effect p => Effect (RL p) Source # | |
Effect p => Effect (FL p) Source # | |
PrimPatch prim => Effect (RepoPatchV1 prim) Source # | |
Defined in Darcs.Patch.V1.Commute effect :: RepoPatchV1 prim wX wY -> FL (PrimOf (RepoPatchV1 prim)) wX wY Source # | |
PrimPatch prim => Effect (RepoPatchV2 prim) Source # | |
Defined in Darcs.Patch.V2.RepoPatch effect :: RepoPatchV2 prim wX wY -> FL (PrimOf (RepoPatchV2 prim)) wX wY Source # | |
Effect p => Effect (Named p) Source # | |
Effect p => Effect (WithDroppedDeps p) Source # | |
Defined in Darcs.Patch.Rebase.Change effect :: WithDroppedDeps p wX wY -> FL (PrimOf (WithDroppedDeps p)) wX wY Source # | |
Effect p => Effect (PatchInfoAndG rt p) Source # | |
Defined in Darcs.Patch.PatchInfoAnd effect :: PatchInfoAndG rt p wX wY -> FL (PrimOf (PatchInfoAndG rt p)) wX wY Source # | |
Effect (RepoPatchV3 name prim) Source # | |
Defined in Darcs.Patch.V3.Core effect :: RepoPatchV3 name prim wX wY -> FL (PrimOf (RepoPatchV3 name prim)) wX wY Source # |
primIsBinary :: PrimClassify prim => prim wX wY -> Bool Source #
primIsAdddir :: PrimClassify prim => prim wX wY -> Bool Source #
dropInverses :: (Invert p, Eq2 p) => FL p wX wY -> Maybe (FL p wX wY) Source #
Delete the first subsequence of patches that is followed by
an inverse subsequence, if one exists. If not return Nothing
.
commuteFL :: Commute p => (p :> FL p) wX wY -> Maybe ((FL p :> p) wX wY) Source #
commuteFL
commutes a single element past a FL.
commuteRL :: Commute p => (RL p :> p) wX wY -> Maybe ((p :> RL p) wX wY) Source #
commuteRL
commutes a RL past a single element.
readPatchPartial :: ReadPatch p => ByteString -> Either String (Sealed (p wX), ByteString) Source #
canonize :: PrimCanonize prim => DiffAlgorithm -> prim wX wY -> FL prim wX wY Source #
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.
sortCoalesceFL :: PrimCanonize prim => FL prim wX wY -> FL prim wX wY Source #
sortCoalesceFL
ps
coalesces as many patches in ps
as
possible, sorting the results in some standard order.
tryToShrink :: PrimCanonize prim => FL prim wX wY -> FL prim wX wY Source #
tryToShrink ps
simplifies ps
by getting rid of self-cancellations
or coalescing patches
Question (Eric Kow): what properties should this have? For example, the prim1 implementation only gets rid of the first self-cancellation it finds (as far as I can tell). Is that OK? Can we try harder?
patchcontents :: Named p wX wY -> FL p wX wY Source #
apply :: (Apply p, ApplyMonad (ApplyState p) m) => p wX wY -> m () Source #
applyToTree :: (Apply p, Monad m, ApplyState p ~ Tree) => p wX wY -> Tree m -> m (Tree m) Source #
maybeApplyToTree :: (Apply p, ApplyState p ~ Tree) => p wX wY -> Tree IO -> IO (Maybe (Tree IO)) Source #
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] Source #
patch2patchinfo :: Named p wX wY -> PatchInfo Source #
plainSummary :: (Summary e, PrimDetails (PrimOf e)) => e wX wY -> Doc Source #
xmlSummary :: (Summary p, PrimDetails (PrimOf p)) => p wX wY -> Doc Source #
plainSummaryPrims :: PrimDetails prim => Bool -> FL prim wX wY -> Doc Source #
listConflictedFiles :: (Summary p, PatchInspect (PrimOf p)) => p wX wY -> [AnchoredPath] Source #
type RepoPatch p = (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) Source #