| darcs-2.4.3: a distributed, interactive, smart revision control system | Source code | Contents | Index
Darcs.Patch.Prim
Synopsis
data Prim where
Move :: !FileName -> !FileName -> Prim
DP :: !FileName -> !DirPatchType -> Prim
FP :: !FileName -> !FilePatchType -> Prim
Split :: FL Prim -> Prim
Identity :: Prim
ChangePref :: !String -> !String -> !String -> Prim
data IsConflictedPrim where
IsC :: !ConflictState -> !Prim -> IsConflictedPrim
data ConflictState
= Okay
| Conflicted
| Duplicated
showPrim :: FileNameFormat -> Prim -> Doc
data DirPatchType
= RmDir
| AddDir
data FilePatchType
= RmFile
| AddFile
| Hunk !Int [ByteString] [ByteString]
| TokReplace !String !String !String
| Binary ByteString ByteString
type CommuteFunction = (Prim :< Prim) -> Perhaps (Prim :< Prim)
data Perhaps a
= Unknown
| Failed
| Succeeded a
null_patch :: Prim
nullP :: Prim -> EqCheck
isNullPatch :: Prim -> Bool
is_identity :: Prim -> EqCheck
formatFileName :: FileNameFormat -> FileName -> Doc
data FileNameFormat
= OldFormat
| NewFormat
adddir :: FilePath -> Prim
addfile :: FilePath -> Prim
binary :: FilePath -> ByteString -> ByteString -> Prim
changepref :: String -> String -> String -> Prim
hunk :: FilePath -> Int -> [ByteString] -> [ByteString] -> Prim
move :: FilePath -> FilePath -> Prim
rmdir :: FilePath -> Prim
rmfile :: FilePath -> Prim
tokreplace :: FilePath -> String -> String -> String -> Prim
primIsAddfile :: Prim -> Bool
primIsHunk :: Prim -> Bool
primIsBinary :: Prim -> Bool
primIsSetpref :: Prim -> Bool
isSimilar :: Prim -> Prim -> Bool
primIsAdddir :: Prim -> Bool
is_filepatch :: Prim -> Maybe FileName
canonize :: Prim -> FL Prim
tryToShrink :: FL Prim -> FL Prim
modernizePrim :: Prim -> FL Prim
subcommutes :: [(String, CommuteFunction)]
sortCoalesceFL :: FL Prim -> FL Prim
join :: (Prim :> Prim) -> Maybe Prim
canonizeFL :: FL Prim -> FL Prim
try_tok_internal :: String -> ByteString -> ByteString -> ByteString -> Maybe [ByteString]
try_shrinking_inverse :: FL Prim -> Maybe (FL Prim)
n_fn :: FilePath -> FilePath
class FromPrim p where
fromPrim :: Prim -> p
class FromPrims p where
fromPrims :: FL Prim -> p
joinPatches :: FL p -> p
class FromPrim p => ToFromPrim p where
toPrim :: p -> Maybe Prim
class (Invert p, Commute p, Effect p) => Conflict p where
listConflictedFiles :: p -> [FilePath]
resolveConflicts :: p -> [[Sealed (FL Prim)]]
commute_no_conflicts :: (p :> p) -> Maybe (p :> p)
conflictedEffect :: p -> [IsConflictedPrim]
class Effect p where
effect :: p -> FL Prim
effectRL :: p -> RL Prim
isHunk :: p -> Maybe Prim
commute_no_conflictsFL :: Conflict p => (p :> FL p) -> Maybe (FL p :> p)
commute_no_conflictsRL :: Conflict p => (RL p :> p) -> Maybe (p :> RL p)
Documentation
data Prim where | Source
Constructors
Move :: !FileName -> !FileName -> Prim |
DP :: !FileName -> !DirPatchType -> Prim |
FP :: !FileName -> !FilePatchType -> Prim |
Split :: FL Prim -> Prim |
Identity :: Prim |
ChangePref :: !String -> !String -> !String -> Prim |
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 IsConflictedPrim where | Source
Constructors
IsC :: !ConflictState -> !Prim -> IsConflictedPrim |
data ConflictState | Source
Constructors
Okay |
Conflicted |
Duplicated |
Instances
Eq ConflictState
Ord ConflictState
Read ConflictState
Show ConflictState
showPrim :: FileNameFormat -> Prim -> Doc | Source
data DirPatchType | Source
Constructors
RmDir |
AddDir |
Instances
Eq DirPatchType
Ord DirPatchType
Show DirPatchType
MyEq DirPatchType
data FilePatchType | Source
Constructors
RmFile |
AddFile |
Hunk !Int [ByteString] [ByteString] |
TokReplace !String !String !String |
Binary ByteString ByteString |
Instances
Eq FilePatchType
Ord FilePatchType
Show FilePatchType
MyEq FilePatchType
type CommuteFunction = (Prim :< Prim) -> Perhaps (Prim :< Prim) | Source
data Perhaps a | Source
Constructors
Unknown |
Failed |
Succeeded a |
Instances
Monad Perhaps
MonadPlus Perhaps
null_patch :: Prim | Source
nullP :: Prim -> EqCheck | Source
isNullPatch :: Prim -> Bool | Source
is_identity :: Prim -> EqCheck | Source
formatFileName :: FileNameFormat -> FileName -> Doc | Source
data FileNameFormat | Source
Constructors
OldFormat |
NewFormat |
adddir :: FilePath -> Prim | Source
addfile :: FilePath -> Prim | Source
binary :: FilePath -> ByteString -> ByteString -> Prim | Source
changepref :: String -> String -> String -> Prim | Source
hunk :: FilePath -> Int -> [ByteString] -> [ByteString] -> Prim | Source
move :: FilePath -> FilePath -> Prim | Source
rmdir :: FilePath -> Prim | Source
rmfile :: FilePath -> Prim | Source
tokreplace :: FilePath -> String -> String -> String -> Prim | Source
primIsAddfile :: Prim -> Bool | Source
primIsHunk :: Prim -> Bool | Source
primIsBinary :: Prim -> Bool | Source
primIsSetpref :: Prim -> Bool | 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.
primIsAdddir :: Prim -> Bool | Source
is_filepatch :: Prim -> Maybe FileName | Source
canonize :: Prim -> FL Prim | Source
tryToShrink :: FL Prim -> FL Prim | Source
modernizePrim :: Prim -> FL Prim | Source
subcommutes :: [(String, CommuteFunction)] | 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`
join :: (Prim :> Prim) -> Maybe Prim | Source
canonizeFL :: FL Prim -> FL Prim | Source
`canonizeFL` `ps` puts 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. Note that this process does not preserve the commutation behaviour of the patches and is therefore not appropriate for use when working with already recorded patches (unless doing amend-record or the like).
try_tok_internal :: String -> ByteString -> ByteString -> ByteString -> Maybe [ByteString] | Source
try_shrinking_inverse :: FL Prim -> Maybe (FL Prim) | Source
n_fn :: FilePath -> FilePath | Source
class FromPrim p where | Source
Methods
fromPrim :: Prim -> p | Source
Instances
FromPrim Prim
FromPrim Patch
FromPrim RealPatch
class FromPrims p where | Source
Methods
fromPrims :: FL Prim -> p | Source
joinPatches :: FL p -> p | Source
Instances
FromPrims Patch
FromPrim p => FromPrims (RL p)
FromPrim p => FromPrims (FL p)
class FromPrim p => ToFromPrim p where | Source
Methods
toPrim :: p -> Maybe Prim | Source
Instances
ToFromPrim Prim
ToFromPrim RealPatch
class (Invert p, Commute p, Effect p) => Conflict p where | Source
Methods
listConflictedFiles :: p -> [FilePath] | Source
resolveConflicts :: p -> [[Sealed (FL Prim)]] | Source
commute_no_conflicts :: (p :> p) -> Maybe (p :> p) | Source
If `commute_no_conflicts` `x :> y` succeeds, we know that that `x` commutes past `y` without any conflicts. This function is useful for patch types for which `commute` is defined to always succeed; so we need some way to pick out the specific cases where commutation succeeds without any conflicts. Consider the commute square with patch names written in capital letters and repository states written in small letters.
              X
           o-->--a
           |     |
        Y' v     v Y
           |     |
           z-->--b
              X'
The default definition of this function checks that we can mirror the commutation with patch inverses (written with the negative sign)
             -X     X
           a-->--o-->--a
           |     |     |
       Y'' v  Y' v     v Y
           |     |     |
           b-->--z-->--b
             (-X)'  X'
We check that commuting `X` and `Y` succeeds, as does commuting `-X` and `Y'`. It also checks that `Y'' == Y` and that `-(X')` is the same as `(-X)'`
conflictedEffect :: p -> [IsConflictedPrim] | Source
Instances
Conflict Prim
Conflict Patch
Conflict RealPatch
Conflict p => Conflict (RL p)
Conflict p => Conflict (FL p)
Conflict p => Conflict (Named p)
Conflict p => Conflict (PatchInfoAnd p)
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
effectRL :: p -> RL Prim | Source
isHunk :: p -> Maybe 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)
commute_no_conflictsFL :: Conflict p => (p :> FL p) -> Maybe (FL p :> p) | Source
commute_no_conflictsRL :: Conflict p => (RL p :> p) -> Maybe (p :> RL p) | Source
Produced by Haddock version 2.4.2