darcs-2.9.1: a distributed, interactive, smart revision control system

Safe HaskellSafe-Infered

Darcs.Patch

Contents

Synopsis

Documentation

data Named p wX wY

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).

class (MyEq p, Apply p, Commute p, PatchInspect p, ShowPatch p, ReadPatch p, Invert p) => Patchy p

Instances

Patchy DummyPatch 
Patchy Prim 
Patchy Prim 
(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 wX wY -> p wX wY

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 :: Patchy p => String -> String -> String -> [String] -> FL p wX wY -> IO (Named p wX wY)

anonymous :: Patchy p => 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, ApplyMonadTrans m (ApplyState p), ApplyMonad m (ApplyState p)) => p wX wY -> m Doc

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

showNicely :: ShowPatch p => p wX wY -> Doc

infopatch :: Patchy p => 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

forceTokReplace replaces all occurrences of the old token with the new token, throughout the input 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

for PatchTest

resolveConflicts :: Conflict p => p wX wY -> [[Sealed (FL (PrimOf p) wY)]]

class Effect p where

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 wX wY -> FL (PrimOf p) wX wY

Instances

Effect p => Effect (RL p) 
Effect p => Effect (FL p) 
PrimPatch prim => Effect (Patch prim) 
Effect p => Effect (Named p) 
Effect p => Effect (PatchInfoAnd p) 
PrimPatch prim => Effect (RealPatch prim) 

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

commuteFLorComplain :: Commute p => (p :> FL p) wX wY -> Either (Sealed2 p) ((FL p :> p) wX wY)

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)

commuteRL commutes a RL past a single element.

readPatch :: ReadPatch p => ByteString -> Maybe (Sealed (p wX))

readPatchPartial :: ReadPatch p => ByteString -> Maybe (Sealed (p wX), ByteString)

canonize :: PrimCanonize prim => prim wX wY -> FL prim wX wY

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

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

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 m (ApplyState p)) => p wX wY -> m ()

applyToTree :: (Apply p, Functor m, Monad m, ApplyState p ~ Tree) => p wX wY -> Tree m -> m (Tree m)

Apply a patch to a Tree, yielding a new Tree.

effectOnFilePaths :: (Apply p, ApplyState p ~ Tree) => p wX wY -> [FilePath] -> [FilePath]

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 => 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