Safe Haskell | None |
---|---|
Language | Haskell2010 |
- class (Patchy p, Merge p, Effect p, IsHunk p, PatchInspect p, ReadPatch p, ShowPatch p, FromPrim p, Conflict p, CommuteNoConflicts p, Check p, RepairToFL p, PatchListFormat p, PrimPatchBase p, Patchy (PrimOf p), IsHunk (PrimOf p), Matchable p) => RepoPatch p
- data RepoType
- class IsRepoType rt
- data Named p wX wY
- data WrappedNamed rt p wX wY
- class (Apply p, Commute p, Invert p) => Patchy p
- fromPrim :: FromPrim p => PrimOf p wX wY -> p wX wY
- fromPrims :: FromPrims p => FL (PrimOf p) wX wY -> p wX wY
- rmfile :: PrimConstruct prim => FilePath -> prim wX wY
- addfile :: PrimConstruct prim => FilePath -> prim wX wY
- rmdir :: PrimConstruct prim => FilePath -> prim wX wY
- adddir :: PrimConstruct prim => FilePath -> prim wX wY
- move :: PrimConstruct prim => FilePath -> FilePath -> prim wX wY
- hunk :: PrimConstruct prim => FilePath -> Int -> [ByteString] -> [ByteString] -> prim wX wY
- tokreplace :: PrimConstruct prim => FilePath -> String -> String -> String -> prim wX wY
- namepatch :: String -> String -> String -> [String] -> FL p wX wY -> IO (Named p wX wY)
- anonymous :: FL p wX wY -> IO (Named p wX wY)
- binary :: PrimConstruct prim => FilePath -> ByteString -> ByteString -> prim wX wY
- description :: ShowPatch p => p wX wY -> Doc
- showContextPatch :: (ShowPatch p, Monad m, ApplyMonad (ApplyState p) m) => p wX wY -> m Doc
- showPatch :: ShowPatchBasic p => p wX wY -> Doc
- showNicely :: ShowPatch p => p wX wY -> Doc
- infopatch :: PatchInfo -> FL 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 -> [FilePath]
- hunkMatches :: PatchInspect p => (ByteString -> Bool) -> p wX wY -> Bool
- forceTokReplace :: String -> ByteString -> ByteString -> ByteString -> ByteString
- class (Patchy prim, MyEq prim, PatchListFormat prim, IsHunk prim, RepairToFL prim, PatchInspect prim, ReadPatch prim, ShowPatch prim, Show2 prim, PrimConstruct prim, PrimCanonize prim, PrimClassify prim, PrimDetails prim, PrimShow prim, PrimRead prim, PrimApply prim) => PrimPatch prim
- resolveConflicts :: Conflict p => p wX wY -> [[Sealed (FL (PrimOf p) wY)]]
- class Effect p where
- 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
- commuteFL :: Commute p => (p :> FL p) wX wY -> Maybe ((FL p :> p) wX wY)
- commuteFLorComplain :: Commute p => (p :> FL p) wX wY -> Either (Sealed2 p) ((FL p :> p) wX wY)
- commuteRL :: Commute p => (RL p :> p) wX wY -> Maybe ((p :> RL p) wX wY)
- readPatch :: ReadPatch p => ByteString -> Maybe (Sealed (p wX))
- readPatchPartial :: ReadPatch p => ByteString -> Maybe (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
- applyToFilePaths :: (Apply p, ApplyState p ~ Tree) => p wX wY -> Maybe [(FilePath, FilePath)] -> [FilePath] -> ([FilePath], [FilePath], [(FilePath, FilePath)])
- apply :: (Apply p, ApplyMonad (ApplyState p) m) => p wX wY -> m ()
- applyToTree :: (Apply p, Functor m, 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))
- effectOnFilePaths :: (Apply p, ApplyState p ~ Tree) => p wX wY -> [FilePath] -> [FilePath]
- patch2patchinfo :: Named p wX wY -> PatchInfo
- summary :: ShowPatch p => p wX wY -> Doc
- summaryFL :: ShowPatch p => FL p wX wY -> Doc
- plainSummary :: (Conflict e, Effect e, PrimPatchBase e) => e wX wY -> Doc
- xmlSummary :: (Effect p, Conflict p, PrimPatchBase p) => p wX wY -> Doc
- plainSummaryPrims :: PrimDetails prim => Bool -> [FileName] -> FL prim wX wY -> Doc
- adddeps :: Named p wX wY -> [PatchInfo] -> Named p wX wY
- getdeps :: Named p wX wY -> [PatchInfo]
- listConflictedFiles :: Conflict p => p wX wY -> [FilePath]
- isInconsistent :: Check p => p wX wY -> Maybe Doc
Documentation
class (Patchy p, Merge p, Effect p, IsHunk p, PatchInspect p, ReadPatch p, ShowPatch p, FromPrim p, Conflict p, CommuteNoConflicts p, Check p, RepairToFL p, PatchListFormat p, PrimPatchBase p, Patchy (PrimOf p), IsHunk (PrimOf p), Matchable p) => RepoPatch p Source #
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 Source #
IsRebaseType rebaseType => IsRepoType (RepoType rebaseType) Source # | |
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
).
data WrappedNamed rt p wX wY Source #
A layer inbetween the 'Named p' type and 'PatchInfoAnd p' design for holding "internal" patches such as the rebase container. Ideally these patches would be stored at the repository level but this would require some significant refactoring/cleaning up of that code.
class (Apply p, Commute p, Invert p) => Patchy p Source #
Patchy DummyPatch Source # | |
Apply p => Patchy (RebaseName p) Source # | |
PrimPatch prim => Patchy (RepoPatchV2 prim) Source # | |
(PrimPatchBase p, Apply p, (~) ((* -> *) -> *) (ApplyState p) (ApplyState (PrimOf p)), Invert p) => Patchy (RebaseChange p) Source # | |
(PrimPatchBase p, PatchListFormat p, Conflict p, FromPrim p, Effect p, CommuteNoConflicts p, IsHunk p, Patchy p, (~) ((* -> *) -> *) (ApplyState p) (ApplyState (PrimOf p))) => Patchy (RebaseSelect p) Source # | |
(Patchy p, (~) ((* -> *) -> *) (ApplyState p) Tree) => Patchy (PatchInfoAnd rt p) Source # | |
rmfile :: PrimConstruct prim => FilePath -> prim wX wY Source #
addfile :: PrimConstruct prim => FilePath -> prim wX wY Source #
rmdir :: PrimConstruct prim => FilePath -> prim wX wY Source #
adddir :: PrimConstruct prim => FilePath -> prim wX wY Source #
hunk :: PrimConstruct prim => FilePath -> Int -> [ByteString] -> [ByteString] -> prim wX wY Source #
tokreplace :: PrimConstruct prim => FilePath -> String -> String -> String -> prim wX wY Source #
binary :: PrimConstruct prim => FilePath -> ByteString -> ByteString -> prim wX wY Source #
description :: ShowPatch p => p wX wY -> Doc Source #
showContextPatch :: (ShowPatch p, Monad m, ApplyMonad (ApplyState p) m) => 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 => p wX wY -> Doc Source #
showNicely :: ShowPatch p => p wX wY -> Doc 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 -> [FilePath] Source #
hunkMatches :: PatchInspect p => (ByteString -> Bool) -> p wX wY -> Bool Source #
forceTokReplace :: String -> ByteString -> ByteString -> ByteString -> ByteString Source #
forceTokReplace replaces all occurrences of the old token with the new token, throughout the input ByteString.
class (Patchy prim, MyEq prim, PatchListFormat prim, IsHunk prim, RepairToFL prim, PatchInspect prim, ReadPatch prim, ShowPatch prim, Show2 prim, PrimConstruct prim, PrimCanonize prim, PrimClassify prim, PrimDetails prim, PrimShow prim, PrimRead prim, PrimApply prim) => PrimPatch prim Source #
for PatchTest
Patches whose concrete effect which can be expressed as a list of primitive patches.
A minimal definition would be either of effect
or effectRL
.
Effect DummyPatch Source # | |
Effect p => Effect (RL p) Source # | |
Effect p => Effect (FL p) Source # | |
Effect p => Effect (Named p) Source # | |
Effect (RebaseName p) Source # | |
Effect (RebaseFixup p) Source # | |
Effect (Suspended p) Source # | |
PrimPatch prim => Effect (RepoPatchV2 prim) Source # | |
Effect p => Effect (WithDroppedDeps p) Source # | |
(PrimPatchBase p, Invert p, Effect p) => Effect (RebaseChange p) Source # | |
(PrimPatchBase p, Invert p, Effect p) => Effect (RebaseSelect p) Source # | |
Effect p => Effect (WrappedNamed rt p) Source # | |
Effect p => Effect (PatchInfoAnd rt p) Source # | |
primIsBinary :: PrimClassify prim => prim wX wY -> Bool Source #
primIsAdddir :: PrimClassify prim => prim wX wY -> Bool Source #
commuteFL :: Commute p => (p :> FL p) wX wY -> Maybe ((FL p :> p) wX wY) Source #
commuteFL
commutes a single element past a FL.
commuteFLorComplain :: Commute p => (p :> FL p) wX wY -> Either (Sealed2 p) ((FL p :> p) wX wY) Source #
commuteFLorComplain
attempts to commute a single element past a FL. If
any individual commute fails, then we return the patch that first patch that
cannot be commuted past.
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 -> Maybe (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 #
applyToFilePaths :: (Apply p, ApplyState p ~ Tree) => p wX wY -> Maybe [(FilePath, FilePath)] -> [FilePath] -> ([FilePath], [FilePath], [(FilePath, FilePath)]) Source #
apply :: (Apply p, ApplyMonad (ApplyState p) m) => p wX wY -> m () Source #
applyToTree :: (Apply p, Functor m, 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 replace patch to a Tree. If the apply fails (if the file the patch applies to already contains the target token), we return Nothing, otherwise we return the updated Tree.
effectOnFilePaths :: (Apply p, ApplyState p ~ Tree) => p wX wY -> [FilePath] -> [FilePath] Source #
patch2patchinfo :: Named p wX wY -> PatchInfo Source #
plainSummary :: (Conflict e, Effect e, PrimPatchBase e) => e wX wY -> Doc Source #
xmlSummary :: (Effect p, Conflict p, PrimPatchBase p) => p wX wY -> Doc Source #
plainSummaryPrims :: PrimDetails prim => Bool -> [FileName] -> FL prim wX wY -> Doc Source #
listConflictedFiles :: Conflict p => p wX wY -> [FilePath] Source #