Safe Haskell | None |
---|---|
Language | Haskell98 |
Darcs.Patch
Contents
- class (Patchy p, Merge p, Effect p, IsHunk p, FromPrim p, Conflict p, CommuteNoConflicts p, Check p, RepairToFL p, PatchListFormat p, PrimPatchBase p, Patchy (PrimOf p), IsHunk (PrimOf p)) => RepoPatch p
- data Named p x y
- class (MyEq p, Apply p, Commute p, PatchInspect p, ShowPatch p, ReadPatch p, Invert p) => Patchy p
- joinPatches :: FromPrims p => FL p x y -> p x y
- fromPrim :: FromPrim p => PrimOf p x y -> p x y
- fromPrims :: FromPrims p => FL (PrimOf p) x y -> p x y
- rmfile :: PrimConstruct prim => FilePath -> prim x y
- addfile :: PrimConstruct prim => FilePath -> prim x y
- rmdir :: PrimConstruct prim => FilePath -> prim x y
- adddir :: PrimConstruct prim => FilePath -> prim x y
- move :: PrimConstruct prim => FilePath -> FilePath -> prim x y
- hunk :: PrimConstruct prim => FilePath -> Int -> [ByteString] -> [ByteString] -> prim x y
- tokreplace :: PrimConstruct prim => FilePath -> String -> String -> String -> prim x y
- namepatch :: Patchy p => String -> String -> String -> [String] -> FL p x y -> IO (Named p x y)
- anonymous :: Patchy p => FL p x y -> IO (Named p x y)
- binary :: PrimConstruct prim => FilePath -> ByteString -> ByteString -> prim x y
- description :: ShowPatch p => p x y -> Doc
- showContextPatch :: (ShowPatch p, Monad m, ApplyMonadTrans m (ApplyState p), ApplyMonad m (ApplyState p)) => p x y -> m Doc
- showPatch :: ShowPatchBasic p => p x y -> Doc
- showNicely :: ShowPatch p => p x y -> Doc
- infopatch :: Patchy p => PatchInfo -> FL p x y -> Named p x y
- changepref :: PrimConstruct prim => String -> String -> String -> prim x y
- thing :: ShowPatch p => p x y -> String
- things :: ShowPatch p => p x y -> String
- primIsAddfile :: PrimClassify prim => prim x y -> Bool
- primIsHunk :: PrimClassify prim => prim x y -> Bool
- primIsSetpref :: PrimClassify prim => prim x y -> Bool
- merge :: Merge p => (p :\/: p) x y -> (p :/\: p) x y
- commute :: Commute p => (p :> p) x y -> Maybe ((p :> p) x y)
- listTouchedFiles :: PatchInspect p => p x y -> [FilePath]
- hunkMatches :: PatchInspect p => (ByteString -> Bool) -> p x y -> Bool
- forceTokReplace :: String -> String -> String -> ByteString -> Maybe ByteString
- class (Patchy prim, PatchListFormat prim, IsHunk prim, RepairToFL prim, PrimConstruct prim, PrimCanonize prim, PrimClassify prim, PrimDetails prim, PrimShow prim, PrimRead prim, PrimApply prim) => PrimPatch prim
- resolveConflicts :: Conflict p => p x y -> [[Sealed (FL (PrimOf p) y)]]
- class Effect p where
- primIsBinary :: PrimClassify prim => prim x y -> Bool
- gzWritePatch :: ShowPatchBasic p => FilePath -> p x y -> IO ()
- writePatch :: ShowPatchBasic p => FilePath -> p x y -> IO ()
- primIsAdddir :: PrimClassify prim => prim x y -> Bool
- invert :: Invert p => p x y -> p y x
- invertFL :: Invert p => FL p x y -> RL p y x
- invertRL :: Invert p => RL p x y -> FL p y x
- commuteFLorComplain :: Commute p => (p :> FL p) x y -> Either (Sealed2 p) ((FL p :> p) x y)
- commuteRL :: Commute p => (RL p :> p) x y -> Maybe ((p :> RL p) x y)
- readPatch :: ReadPatch p => ByteString -> Maybe (Sealed (p x))
- readPatchPartial :: ReadPatch p => ByteString -> Maybe (Sealed (p x), ByteString)
- canonize :: PrimCanonize prim => prim x y -> FL prim x y
- sortCoalesceFL :: PrimCanonize prim => FL prim x y -> FL prim x y
- tryToShrink :: PrimCanonize prim => FL prim x y -> FL prim x y
- patchname :: Named p x y -> String
- patchcontents :: Named p x y -> FL p x y
- applyToFilePaths :: (Apply p, ApplyState p ~ Tree) => p x y -> Maybe [(FilePath, FilePath)] -> [FilePath] -> ([FilePath], [FilePath], [(FilePath, FilePath)])
- apply :: (Apply p, ApplyMonad m (ApplyState p)) => p x y -> m ()
- applyToTree :: (Apply p, Functor m, Monad m, ApplyState p ~ Tree) => p x y -> Tree m -> m (Tree m)
- effectOnFilePaths :: (Apply p, ApplyState p ~ Tree) => p x y -> [FilePath] -> [FilePath]
- patch2patchinfo :: Named p x y -> PatchInfo
- summary :: ShowPatch p => p x y -> Doc
- summaryFL :: ShowPatch p => FL p x y -> Doc
- plainSummary :: (Conflict e, Effect e, PrimPatchBase e) => e x y -> Doc
- xmlSummary :: (Effect p, Conflict p, PrimPatchBase p) => p x y -> Doc
- plainSummaryPrims :: PrimDetails prim => FL prim x y -> Doc
- adddeps :: Named p x y -> [PatchInfo] -> Named p x y
- getdeps :: Named p x y -> [PatchInfo]
- listConflictedFiles :: Conflict p => p x y -> [FilePath]
- isInconsistent :: Check p => p x y -> Maybe Doc
Documentation
class (Patchy p, Merge p, Effect p, IsHunk p, FromPrim p, Conflict p, CommuteNoConflicts p, Check p, RepairToFL p, PatchListFormat p, PrimPatchBase p, Patchy (PrimOf p), IsHunk (PrimOf p)) => RepoPatch p 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
).
Instances
class (MyEq p, Apply p, Commute p, PatchInspect p, ShowPatch p, ReadPatch p, Invert p) => Patchy p Source
Instances
Patchy Prim | |
Patchy Prim | |
Patchy DummyPatch | |
(IsHunk p, PatchListFormat p, Patchy p) => Patchy (RL p) | |
(IsHunk p, PatchListFormat p, Patchy p) => Patchy (FL p) | |
PrimPatch prim => Patchy (Patch prim) | |
(CommuteNoConflicts p, Conflict p, IsHunk p, PatchListFormat p, PrimPatchBase p, Patchy p, (~) ((* -> *) -> *) (ApplyState p) Tree) => Patchy (Named p) | |
(RepoPatch p, (~) ((* -> *) -> *) (ApplyState p) Tree) => Patchy (PatchInfoAnd p) | |
PrimPatch prim => Patchy (RealPatch prim) |
joinPatches :: FromPrims p => FL p x y -> p x y Source
rmfile :: PrimConstruct prim => FilePath -> prim x y Source
addfile :: PrimConstruct prim => FilePath -> prim x y Source
rmdir :: PrimConstruct prim => FilePath -> prim x y Source
adddir :: PrimConstruct prim => FilePath -> prim x y Source
move :: PrimConstruct prim => FilePath -> FilePath -> prim x y Source
hunk :: PrimConstruct prim => FilePath -> Int -> [ByteString] -> [ByteString] -> prim x y Source
tokreplace :: PrimConstruct prim => FilePath -> String -> String -> String -> prim x y Source
namepatch :: Patchy p => String -> String -> String -> [String] -> FL p x y -> IO (Named p x y) Source
binary :: PrimConstruct prim => FilePath -> ByteString -> ByteString -> prim x y Source
description :: ShowPatch p => p x y -> Doc Source
showContextPatch :: (ShowPatch p, Monad m, ApplyMonadTrans m (ApplyState p), ApplyMonad m (ApplyState p)) => p x y -> 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 x y -> Doc Source
showNicely :: ShowPatch p => p x y -> Doc Source
changepref :: PrimConstruct prim => String -> String -> String -> prim x y Source
primIsAddfile :: PrimClassify prim => prim x y -> Bool Source
primIsHunk :: PrimClassify prim => prim x y -> Bool Source
primIsSetpref :: PrimClassify prim => prim x y -> Bool Source
listTouchedFiles :: PatchInspect p => p x y -> [FilePath] Source
hunkMatches :: PatchInspect p => (ByteString -> Bool) -> p x y -> Bool Source
forceTokReplace :: String -> String -> String -> ByteString -> Maybe ByteString Source
class (Patchy prim, PatchListFormat prim, IsHunk prim, RepairToFL 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
.
Minimal complete definition
Nothing
primIsBinary :: PrimClassify prim => prim x y -> Bool Source
gzWritePatch :: ShowPatchBasic p => FilePath -> p x y -> IO () Source
writePatch :: ShowPatchBasic p => FilePath -> p x y -> IO () Source
primIsAdddir :: PrimClassify prim => prim x y -> Bool Source
readPatchPartial :: ReadPatch p => ByteString -> Maybe (Sealed (p x), ByteString) Source
canonize :: PrimCanonize prim => prim x y -> FL prim x y 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 x y -> FL prim x y Source
sortCoalesceFL
ps
coalesces as many patches in ps
as
possible, sorting the results in some standard order.
tryToShrink :: PrimCanonize prim => FL prim x y -> FL prim x y Source
patchcontents :: Named p x y -> FL p x y Source
applyToFilePaths :: (Apply p, ApplyState p ~ Tree) => p x y -> Maybe [(FilePath, FilePath)] -> [FilePath] -> ([FilePath], [FilePath], [(FilePath, FilePath)]) Source
apply :: (Apply p, ApplyMonad m (ApplyState p)) => p x y -> m () Source
applyToTree :: (Apply p, Functor m, Monad m, ApplyState p ~ Tree) => p x y -> Tree m -> m (Tree m) Source
effectOnFilePaths :: (Apply p, ApplyState p ~ Tree) => p x y -> [FilePath] -> [FilePath] Source
patch2patchinfo :: Named p x y -> PatchInfo Source
plainSummary :: (Conflict e, Effect e, PrimPatchBase e) => e x y -> Doc Source
xmlSummary :: (Effect p, Conflict p, PrimPatchBase p) => p x y -> Doc Source
plainSummaryPrims :: PrimDetails prim => FL prim x y -> Doc Source
listConflictedFiles :: Conflict p => p x y -> [FilePath] Source
isInconsistent :: Check p => p x y -> Maybe Doc Source