| darcs-2.4.3: a distributed, interactive, smart revision control system | Source code | Contents | Index
Darcs.Patch
Synopsis
class (Patchy p, Effect p, FromPrims p, Conflict p) => RepoPatch p
data Prim
data Patch
data RealPatch
data Named p
class (Apply p, Commute p, ShowPatch p, ReadPatch p, Invert p) => Patchy p
flattenFL :: Patch -> FL Patch
joinPatches :: FromPrims p => FL p -> p
fromPrim :: FromPrim p => Prim -> p
fromPrims :: FromPrims p => FL Prim -> p
isNullPatch :: Patch -> Bool
nullP :: Patch -> EqCheck
rmfile :: FilePath -> Prim
addfile :: FilePath -> Prim
rmdir :: FilePath -> Prim
adddir :: FilePath -> Prim
move :: FilePath -> FilePath -> Prim
hunk :: FilePath -> Int -> [ByteString] -> [ByteString] -> Prim
tokreplace :: FilePath -> String -> String -> String -> Prim
namepatch :: Patchy p => String -> String -> String -> [String] -> p -> IO (Named p)
anonymous :: Patchy p => p -> IO (Named p)
binary :: FilePath -> ByteString -> ByteString -> Prim
description :: ShowPatch p => p -> Doc
showContextPatch :: ShowPatch p => p -> TreeIO Doc
showPatch :: ShowPatch p => p -> Doc
showNicely :: ShowPatch p => p -> Doc
infopatch :: Patchy p => PatchInfo -> p -> Named p
changepref :: String -> String -> String -> Prim
thing :: ShowPatch p => p -> String
things :: ShowPatch p => p -> String
isSimilar :: Prim -> Prim -> Bool
primIsAddfile :: Prim -> Bool
primIsHunk :: Prim -> Bool
primIsSetpref :: Prim -> Bool
merger :: String -> Patch -> Patch -> Patch
isMerger :: Patch -> Bool
merge :: Commute p => (p :\/: p) -> p :/\: p
commute :: Commute p => (p :> p) -> Maybe (p :> p)
listTouchedFiles :: Commute p => p -> [FilePath]
hunkMatches :: Commute p => (ByteString -> Bool) -> p -> Bool
unravel :: Patch -> [FL Prim]
elegantMerge :: (Patch :\/: Patch) -> Maybe (Patch :/\: Patch)
resolveConflicts :: Conflict p => p -> [[Sealed (FL Prim)]]
class Effect p where
effect :: p -> FL Prim
primIsBinary :: Prim -> Bool
gzWritePatch :: ShowPatch p => FilePath -> p -> IO ()
writePatch :: ShowPatch p => FilePath -> p -> IO ()
primIsAdddir :: Prim -> Bool
invert :: Invert p => p -> p
invertFL :: Invert p => FL p -> RL p
invertRL :: Invert p => RL p -> FL p
identity :: Invert p => p
commuteFL :: Commute p => (p :> FL p) -> Either (Sealed2 p) (FL p :> p)
commuteRL :: Commute p => (RL p :> p) -> Maybe (p :> RL p)
readPatch :: ReadPatch p => ByteString -> Maybe (Sealed p, ByteString)
canonize :: Prim -> FL Prim
sortCoalesceFL :: FL Prim -> FL Prim
tryToShrink :: FL Prim -> FL Prim
applyToSlurpy :: (Apply p, Monad m) => p -> Slurpy -> m Slurpy
patchname :: Named p -> String
patchcontents :: Named p -> p
applyToFilepaths :: Apply p => p -> [FilePath] -> [FilePath]
forceReplaceSlurpy :: Prim -> Slurpy -> Maybe Slurpy
apply :: (Apply p, WriteableDirectory m) => [DarcsFlag] -> p -> m ()
applyToTree :: Apply p => p -> Tree IO -> IO (Tree IO)
patch2patchinfo :: Named p -> PatchInfo
data LineMark
= AddedLine PatchInfo
| RemovedLine PatchInfo
| AddedRemovedLine PatchInfo PatchInfo
| None
type MarkedUpFile = [(ByteString, LineMark)]
markupFile :: Effect p => PatchInfo -> p -> (FilePath, MarkedUpFile) -> (FilePath, MarkedUpFile)
emptyMarkedupFile :: MarkedUpFile
summary :: ShowPatch p => p -> Doc
plainSummary :: (Conflict e, Effect e) => e -> Doc
xmlSummary :: (Effect p, Patchy p, Conflict p) => Named p -> Doc
adddeps :: Named p -> [PatchInfo] -> Named p
getdeps :: Named p -> [PatchInfo]
listConflictedFiles :: Conflict p => p -> [FilePath]
modernizePatch :: Patch -> Patch
data DirMark
= AddedFile
| RemovedFile
| MovedFile String
| ModifiedFile
| DullFile
| AddedDir
| RemovedDir
| MovedDir !String
| DullDir
patchChanges :: Prim -> [(String, DirMark)]
applyToPop :: PatchInfo -> FL Prim -> Population -> Population
Documentation
class (Patchy p, Effect p, FromPrims p, Conflict p) => RepoPatch p | Source
Instances
RepoPatch Patch
RepoPatchBase p => RepoPatch (FL p)
data Prim | Source
Instances
Show Prim
Show2 Prim
MyEq Prim
Invert Prim
ReadPatch Prim
ShowPatch Prim
Commute Prim
Apply Prim
Patchy Prim
Effect Prim
Conflict Prim
ToFromPrim Prim
FromPrim Prim
Nonable Prim
data Patch | Source
Instances
Show Patch
MyEq Patch
Invert Patch
ReadPatch Patch
ShowPatch Patch
Commute Patch
Apply Patch
Patchy Patch
Effect Patch
Conflict Patch
FromPrims Patch
FromPrim Patch
RepoPatch Patch
RepoPatchBase Patch
data RealPatch | Source
`Duplicate x`: This patch has no effect since `x` is already present in the repository
    Etacilpud x: invert (Duplicate x)
`Normal prim`: A primitive patch `Conflictor ix xx x`: `ix` is the set of patches: that conflict with `x` and also conflict with another patch in the repository that conflict with a patch that conflict with `x` `xx` is the sequence of patches that conflict *only* with `x` `x` is the current patch `ix` and `x` are stored as `Non` objects, which include any necessary context to uniquely define the patch that is referred to. `InvConflictor ix xx x`: like `invert (Conflictor ix xx x)`
Instances
Show RealPatch
Show2 RealPatch
MyEq RealPatch
Invert RealPatch
ReadPatch RealPatch
ShowPatch RealPatch
Commute RealPatch
Apply RealPatch
Patchy RealPatch
Effect RealPatch
Conflict RealPatch
ToFromPrim RealPatch
FromPrim RealPatch
Nonable RealPatch
RepoPatchBase RealPatch
data Named 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
(Conflict p, ShowPatch p) => Show (Named p)
MyEq p => MyEq (Named p)
Invert p => Invert (Named p)
ReadPatch p => ReadPatch (Named p)
(Conflict p, ShowPatch p) => ShowPatch (Named p)
Commute p => Commute (Named p)
Apply p => Apply (Named p)
(Conflict p, Effect p, Patchy p) => Patchy (Named p)
Effect p => Effect (Named p)
Conflict p => Conflict (Named p)
class (Apply p, Commute p, ShowPatch p, ReadPatch p, Invert p) => Patchy p | Source
Instances
Patchy Prim
Patchy Patch
Patchy RealPatch
(Conflict p, Patchy p) => Patchy (RL p)
(Conflict p, Patchy p) => Patchy (FL p)
(Conflict p, Effect p, Patchy p) => Patchy (Named p)
RepoPatch p => Patchy (PatchInfoAnd p)
flattenFL :: Patch -> FL Patch | Source
joinPatches :: FromPrims p => FL p -> p | Source
fromPrim :: FromPrim p => Prim -> p | Source
fromPrims :: FromPrims p => FL Prim -> p | Source
isNullPatch :: Patch -> Bool | Source
nullP :: Patch -> EqCheck | Source
rmfile :: FilePath -> Prim | Source
addfile :: FilePath -> Prim | Source
rmdir :: FilePath -> Prim | Source
adddir :: FilePath -> Prim | Source
move :: FilePath -> FilePath -> Prim | Source
hunk :: FilePath -> Int -> [ByteString] -> [ByteString] -> Prim | Source
tokreplace :: FilePath -> String -> String -> String -> Prim | Source
namepatch :: Patchy p => String -> String -> String -> [String] -> p -> IO (Named p) | Source
anonymous :: Patchy p => p -> IO (Named p) | Source
binary :: FilePath -> ByteString -> ByteString -> Prim | Source
description :: ShowPatch p => p -> Doc | Source
showContextPatch :: ShowPatch p => p -> TreeIO Doc | Source
showPatch :: ShowPatch p => p -> Doc | Source
showNicely :: ShowPatch p => p -> Doc | Source
infopatch :: Patchy p => PatchInfo -> p -> Named p | Source
changepref :: String -> String -> String -> Prim | Source
thing :: ShowPatch p => p -> String | Source
things :: ShowPatch p => p -> String | Source
isSimilar :: Prim -> Prim -> Bool | Source
Tells you if two patches are in the same category, human-wise. Currently just returns true if they are filepatches on the same file.
primIsAddfile :: Prim -> Bool | Source
primIsHunk :: Prim -> Bool | Source
primIsSetpref :: Prim -> Bool | Source
merger :: String -> Patch -> Patch -> Patch | Source
isMerger :: Patch -> Bool | Source
merge :: Commute p => (p :\/: p) -> p :/\: p | Source
commute :: Commute p => (p :> p) -> Maybe (p :> p) | Source
listTouchedFiles :: Commute p => p -> [FilePath] | Source
hunkMatches :: Commute p => (ByteString -> Bool) -> p -> Bool | Source
unravel :: Patch -> [FL Prim] | Source
elegantMerge :: (Patch :\/: Patch) -> Maybe (Patch :/\: Patch) | Source
resolveConflicts :: Conflict p => p -> [[Sealed (FL Prim)]] | Source
class Effect p where | Source
Patches whose concrete effect which can be expressed as a list of primitive patches. A minimal definition would be either of `effect` or `effectRL`.
Methods
effect :: p -> FL Prim | Source
Instances
Effect Prim
Effect Patch
Effect RealPatch
Effect p => Effect (RL p)
Effect p => Effect (FL p)
Effect p => Effect (Named p)
Effect p => Effect (PatchInfoAnd p)
primIsBinary :: Prim -> Bool | Source
gzWritePatch :: ShowPatch p => FilePath -> p -> IO () | Source
writePatch :: ShowPatch p => FilePath -> p -> IO () | Source
primIsAdddir :: Prim -> Bool | Source
invert :: Invert p => p -> p | Source
invertFL :: Invert p => FL p -> RL p | Source
invertRL :: Invert p => RL p -> FL p | Source
identity :: Invert p => p | Source
commuteFL :: Commute p => (p :> FL p) -> Either (Sealed2 p) (FL p :> p) | Source
commuteRL :: Commute p => (RL p :> p) -> Maybe (p :> RL p) | Source
readPatch :: ReadPatch p => ByteString -> Maybe (Sealed p, ByteString) | Source
canonize :: Prim -> FL Prim | Source
sortCoalesceFL :: FL Prim -> FL Prim | Source
`sortCoalesceFL` `ps` coalesces as many patches in `ps` as possible, sorting the results according to the scheme defined in `comparePrim`
tryToShrink :: FL Prim -> FL Prim | Source
applyToSlurpy :: (Apply p, Monad m) => p -> Slurpy -> m Slurpy | Source
patchname :: Named p -> String | Source
patchcontents :: Named p -> p | Source
applyToFilepaths :: Apply p => p -> [FilePath] -> [FilePath] | Source
forceReplaceSlurpy :: Prim -> Slurpy -> Maybe Slurpy | Source
apply :: (Apply p, WriteableDirectory m) => [DarcsFlag] -> p -> m () | Source
applyToTree :: Apply p => p -> Tree IO -> IO (Tree IO) | Source
Apply a patch to a `Tree`, yielding a new `Tree`.
patch2patchinfo :: Named p -> PatchInfo | Source
data LineMark | Source
Constructors
AddedLine PatchInfo |
RemovedLine PatchInfo |
AddedRemovedLine PatchInfo PatchInfo |
None |
Instances
Show LineMark
type MarkedUpFile = [(ByteString, LineMark)] | Source
markupFile :: Effect p => PatchInfo -> p -> (FilePath, MarkedUpFile) -> (FilePath, MarkedUpFile) | Source
emptyMarkedupFile :: MarkedUpFile | Source
summary :: ShowPatch p => p -> Doc | Source
plainSummary :: (Conflict e, Effect e) => e -> Doc | Source
xmlSummary :: (Effect p, Patchy p, Conflict p) => Named p -> Doc | Source
adddeps :: Named p -> [PatchInfo] -> Named p | Source
getdeps :: Named p -> [PatchInfo] | Source
listConflictedFiles :: Conflict p => p -> [FilePath] | Source
modernizePatch :: Patch -> Patch | Source
data DirMark | Source
info of a directory member
Constructors
AddedFile |
RemovedFile |
MovedFile String |
ModifiedFile |
DullFile |
AddedDir |
RemovedDir |
MovedDir !String |
DullDir |
Instances
Eq DirMark
Ord DirMark
Show DirMark
patchChanges :: Prim -> [(String, DirMark)] | Source
applyToPop :: PatchInfo -> FL Prim -> Population -> Population | Source
Produced by Haddock version 2.4.2