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

Safe Haskell | Safe-Inferred
Language | Haskell2010

Darcs.Patch

Contents

- for PatchTest

Synopsis

- data RepoType
- class IsRepoType (rt :: RepoType)
- class PrimPatch (PrimOf p) => PrimPatchBase p where
  - type PrimOf (p :: * -> * -> *) :: * -> * -> *
- data Named p wX wY
- type family ApplyState p :: (* -> *) -> *
- rmfile :: PrimConstruct prim => AnchoredPath -> prim wX wY
- addfile :: PrimConstruct prim => AnchoredPath -> prim wX wY
- rmdir :: PrimConstruct prim => AnchoredPath -> prim wX wY
- adddir :: PrimConstruct prim => AnchoredPath -> prim wX wY
- move :: PrimConstruct prim => AnchoredPath -> AnchoredPath -> prim wX wY
- hunk :: PrimConstruct prim => AnchoredPath -> Int -> [ByteString] -> [ByteString] -> prim wX wY
- tokreplace :: PrimConstruct prim => AnchoredPath -> String -> String -> String -> prim wX wY
- anonymous :: FromPrim p => FL (PrimOf p) wX wY -> IO (Named p wX wY)
- binary :: PrimConstruct prim => AnchoredPath -> ByteString -> ByteString -> prim wX wY
- description :: ShowPatch p => p wX wY -> Doc
- showContextPatch :: (ShowContextPatch p, ApplyMonad (ApplyState p) m) => ShowPatchFor -> p wX wY -> m Doc
- data ShowPatchFor
  - = ForDisplay
  - | ForStorage
- showPatch :: ShowPatchBasic p => ShowPatchFor -> p wX wY -> Doc
- displayPatch :: ShowPatchBasic p => p wX wY -> Doc
- content :: ShowPatch p => p wX wY -> Doc
- infopatch :: forall p wX wY. FromPrim p => PatchInfo -> FL (PrimOf 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 -> [AnchoredPath]
- hunkMatches :: PatchInspect p => (ByteString -> Bool) -> p wX wY -> Bool
- forceTokReplace :: String -> ByteString -> ByteString -> ByteString -> ByteString
- type PrimPatch prim = (Apply prim, CleanMerge prim, Commute prim, Invert prim, Eq2 prim, IsHunk prim, PatchInspect prim, RepairToFL prim, Show2 prim, PrimConstruct prim, PrimCanonize prim, PrimClassify prim, PrimDetails prim, PrimApply prim, PrimSift prim, PrimMangleUnravelled prim, ReadPatch prim, ShowPatch prim, ShowContextPatch prim, PatchListFormat prim)
- resolveConflicts :: Conflict p => RL p wO wX -> RL p wX wY -> [ConflictDetails (PrimOf p) wY]
- class Effect p
- 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
- dropInverses :: (Invert p, Eq2 p) => FL p wX wY -> Maybe (FL p wX wY)
- commuteFL :: Commute p => (p :> FL p) wX wY -> Maybe ((FL p :> p) wX wY)
- commuteRL :: Commute p => (RL p :> p) wX wY -> Maybe ((p :> RL p) wX wY)
- readPatch :: ReadPatch p => ByteString -> Either String (Sealed (p wX))
- readPatchPartial :: ReadPatch p => ByteString -> Either String (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
- apply :: (Apply p, ApplyMonad (ApplyState p) m) => p wX wY -> m ()
- applyToTree :: (Apply p, 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))
- effectOnPaths :: (Apply p, ApplyState p ~ Tree) => p wX wY -> [AnchoredPath] -> [AnchoredPath]
- patch2patchinfo :: Named p wX wY -> PatchInfo
- summary :: ShowPatch p => p wX wY -> Doc
- summaryFL :: ShowPatch p => FL p wX wY -> Doc
- plainSummary :: (Summary e, PrimDetails (PrimOf e)) => e wX wY -> Doc
- xmlSummary :: (Summary p, PrimDetails (PrimOf p)) => p wX wY -> Doc
- plainSummaryPrims :: PrimDetails prim => Bool -> FL prim wX wY -> Doc
- adddeps :: Named p wX wY -> [PatchInfo] -> Named p wX wY
- getdeps :: HasDeps p => p wX wY -> [PatchInfo]
- listConflictedFiles :: (Summary p, PatchInspect (PrimOf p)) => p wX wY -> [AnchoredPath]
- isInconsistent :: Check p => p wX wY -> Maybe Doc
- type RepoPatch p = (AnnotateRP p, Apply p, ApplyState p ~ ApplyState (PrimOf p), Check p, Commute p, Conflict p, Effect p, Eq2 p, FromPrim p, IsHunk p, IsHunk (PrimOf p), Merge p, PatchInspect p, PatchListFormat p, PrimPatchBase p, ReadPatch p, RepairToFL p, ShowContextPatch p, ShowPatch p, Summary p, ToPrim p, Unwind p)

# Documentation

data RepoType #

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 :: RepoType) #

Minimal complete definition

singletonRepoType

#### Instances

Instances details

IsRebaseType rebaseType => IsRepoType ('RepoType rebaseType) # |
Instance details Defined in Darcs.Patch.RepoType Methods singletonRepoType :: SRepoType ('RepoType rebaseType) #

class PrimPatch (PrimOf p) => PrimPatchBase p #

Associated Types

type PrimOf (p :: * -> * -> *) :: * -> * -> * #

#### Instances

Instances details

PrimPatchBase p => PrimPatchBase (Invertible p) # |
Instance details Defined in Darcs.Patch.Invertible Associated Types type PrimOf (Invertible p) :: Type -> Type -> Type #
PrimPatchBase p => PrimPatchBase (Named p) # |
Instance details Defined in Darcs.Patch.Named Associated Types type PrimOf (Named p) :: Type -> Type -> Type #
PrimPatch prim => PrimPatchBase (RebaseChange prim) # |
Instance details Defined in Darcs.Patch.Rebase.Change Associated Types type PrimOf (RebaseChange prim) :: Type -> Type -> Type #
PrimPatchBase p => PrimPatchBase (WithDroppedDeps p) # |
Instance details Defined in Darcs.Patch.Rebase.Change Associated Types type PrimOf (WithDroppedDeps p) :: Type -> Type -> Type #
PrimPatch prim => PrimPatchBase (RebaseFixup prim) # |
Instance details Defined in Darcs.Patch.Rebase.Fixup Associated Types type PrimOf (RebaseFixup prim) :: Type -> Type -> Type #
PrimPatch prim => PrimPatchBase (RepoPatchV1 prim) # |
Instance details Defined in Darcs.Patch.V1.Core Associated Types type PrimOf (RepoPatchV1 prim) :: Type -> Type -> Type #
PrimPatch prim => PrimPatchBase (RepoPatchV2 prim) # |
Instance details Defined in Darcs.Patch.V2.RepoPatch Associated Types type PrimOf (RepoPatchV2 prim) :: Type -> Type -> Type #
PrimPatchBase p => PrimPatchBase (FL p) # |
Instance details Defined in Darcs.Patch.FromPrim Associated Types type PrimOf (FL p) :: Type -> Type -> Type #
PrimPatchBase p => PrimPatchBase (RL p) # |
Instance details Defined in Darcs.Patch.FromPrim Associated Types type PrimOf (RL p) :: Type -> Type -> Type #
PrimPatchBase p => PrimPatchBase (WrappedNamed rt p) # |
Instance details Defined in Darcs.Patch.Named.Wrapped Associated Types type PrimOf (WrappedNamed rt p) :: Type -> Type -> Type #
PrimPatchBase p => PrimPatchBase (PatchInfoAndG rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Associated Types type PrimOf (PatchInfoAndG rt p) :: Type -> Type -> Type #
PrimPatch prim => PrimPatchBase (RepoPatchV3 name prim) # |
Instance details Defined in Darcs.Patch.V3.Core Associated Types type PrimOf (RepoPatchV3 name prim) :: Type -> Type -> Type #

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

#### Instances

Instances details

Apply p => Apply (Named p) # |
Instance details Defined in Darcs.Patch.Named Associated Types type ApplyState (Named p) :: (Type -> Type) -> Type # Methods apply :: ApplyMonad (ApplyState (Named p)) m => Named p wX wY -> m () # unapply :: ApplyMonad (ApplyState (Named p)) m => Named p wX wY -> m () #
Commute p => Commute (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods commute :: (Named p :> Named p) wX wY -> Maybe ((Named p :> Named p) wX wY) #
(Commute p, Conflict p) => Conflict (Named p) # | This instance takes care of handling the interaction between conflict resolution and explicit dependencies. By definition, a conflict counts as resolved if another patch depends on it. This principle extends to explicit dependencies between `Named` patches, but not to (aggregate) implicit dependencies. This means we count any patch inside a `Named` patch as resolved if some later `Named` patch depends on it explicitly. The patches contained inside a `Named` patch that is not explicitly depended on must be commuted one by one past those we know are resolved. It is important to realize that we must not do this commutation at the `Named` patch level but at the level below that.
Instance details Defined in Darcs.Patch.Named Methods resolveConflicts :: RL (Named p) wO wX -> RL (Named p) wX wY -> [ConflictDetails (PrimOf (Named p)) wY] #
PatchDebug p => PatchDebug (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods patchDebugDummy :: Named p wX wY -> () #
Effect p => Effect (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods effect :: Named p wX wY -> FL (PrimOf (Named p)) wX wY #
IsHunk (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods isHunk :: Named p wX wY -> Maybe (FileHunk wX wY) #
PatchListFormat (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods patchListFormat :: ListFormat (Named p) #
PrimPatchBase p => PrimPatchBase (Named p) # |
Instance details Defined in Darcs.Patch.Named Associated Types type PrimOf (Named p) :: Type -> Type -> Type #
IdEq2 (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods (=\^/=) :: Named p wA wB -> Named p wA wC -> EqCheck wB wC # (=/^\=) :: Named p wA wC -> Named p wB wC -> EqCheck wA wB #
Ident (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods ident :: Named p wX wY -> PatchId (Named p) #
PatchInspect p => PatchInspect (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods listTouchedFiles :: Named p wX wY -> [AnchoredPath] # hunkMatches :: (ByteString -> Bool) -> Named p wX wY -> Bool #
CleanMerge p => CleanMerge (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods cleanMerge :: (Named p :\/: Named p) wX wY -> Maybe ((Named p :/\: Named p) wX wY) #
Merge p => Merge (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods merge :: (Named p :\/: Named p) wX wY -> (Named p :/\: Named p) wX wY #
HasDeps (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods getdeps :: Named p wX wY -> [PatchInfo] #
(ReadPatch p, PatchListFormat p) => ReadPatch (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods readPatch' :: Parser (Sealed (Named p wX)) #
Check p => Check (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods isInconsistent :: Named p wX wY -> Maybe Doc #
RepairToFL p => Repair (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods applyAndTryToFix :: ApplyMonad (ApplyState (Named p)) m => Named p wX wY -> m (Maybe (String, Named p wX wY)) #
(Apply p, IsHunk p, PatchListFormat p, ShowContextPatch p) => ShowContextPatch (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods showContextPatch :: ApplyMonad (ApplyState (Named p)) m => ShowPatchFor -> Named p wX wY -> m Doc #
(Summary p, PatchListFormat p, PrimPatchBase p, ShowPatch p) => ShowPatch (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods content :: Named p wX wY -> Doc # description :: Named p wX wY -> Doc # summary :: Named p wX wY -> Doc # summaryFL :: FL (Named p) wX wY -> Doc # thing :: Named p wX wY -> String # things :: Named p wX wY -> String #
(PatchListFormat p, ShowPatchBasic p) => ShowPatchBasic (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods showPatch :: ShowPatchFor -> Named p wX wY -> Doc #
Summary p => Summary (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods conflictedEffect :: Named p wX wY -> [IsConflictedPrim (PrimOf (Named p))] #
(PrimPatchBase p, Unwind p) => Unwind (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods fullUnwind :: Named p wX wY -> Unwound (PrimOf (Named p)) wX wY #
Eq2 (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods unsafeCompare :: Named p wA wB -> Named p wC wD -> Bool # (=\/=) :: Named p wA wB -> Named p wA wC -> EqCheck wB wC # (=/\=) :: Named p wA wC -> Named p wB wC -> EqCheck wA wB #
Show2 p => Show2 (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods showDict2 :: ShowDict (Named p wX wY) #
(Commute p, Conflict p) => Conflict (PatchInfoAnd rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods resolveConflicts :: RL (PatchInfoAnd rt p) wO wX -> RL (PatchInfoAnd rt p) wX wY -> [ConflictDetails (PrimOf (PatchInfoAnd rt p)) wY] #
RepairToFL p => Repair (PatchInfoAnd rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods applyAndTryToFix :: ApplyMonad (ApplyState (PatchInfoAnd rt p)) m => PatchInfoAnd rt p wX wY -> m (Maybe (String, PatchInfoAnd rt p wX wY)) #
Show2 p => Show1 (Named p wX) # |
Instance details Defined in Darcs.Patch.Named Methods showDict1 :: Dict (Show (Named p wX wX0)) #
Show2 p => Show2 (PatchInfoAnd rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods showDict2 :: ShowDict (PatchInfoAnd rt p wX wY) #
Show2 p => Show (Named p wX wY) # |
Instance details Defined in Darcs.Patch.Named Methods showsPrec :: Int -> Named p wX wY -> ShowS # show :: Named p wX wY -> String # showList :: [Named p wX wY] -> ShowS #
Show2 p => Show1 (PatchInfoAnd rt p wX) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods showDict1 :: Dict (Show (PatchInfoAnd rt p wX wX0)) #
type ApplyState (Named p) # |
Instance details Defined in Darcs.Patch.Named type ApplyState (Named p) = ApplyState p
type PrimOf (Named p) # |
Instance details Defined in Darcs.Patch.Named type PrimOf (Named p) = PrimOf p
type PatchId (Named p) # |
Instance details Defined in Darcs.Patch.Named type PatchId (Named p) = PatchInfo

type family ApplyState p :: (* -> *) -> * #

#### Instances

Instances details

type ApplyState Prim # |
Instance details Defined in Darcs.Patch.Prim.FileUUID.Apply type ApplyState Prim = ObjectMap
type ApplyState Prim # |
Instance details Defined in Darcs.Patch.Prim.V1.Apply type ApplyState Prim = Tree
type ApplyState Prim # |
Instance details Defined in Darcs.Patch.V1.Prim type ApplyState Prim = ApplyState Prim
type ApplyState Prim # |
Instance details Defined in Darcs.Patch.V2.Prim type ApplyState Prim = ApplyState Prim
type ApplyState (Invertible p) # |
Instance details Defined in Darcs.Patch.Invertible type ApplyState (Invertible p) = ApplyState p
type ApplyState (Named p) # |
Instance details Defined in Darcs.Patch.Named type ApplyState (Named p) = ApplyState p
type ApplyState (RebaseChange prim) # |
Instance details Defined in Darcs.Patch.Rebase.Change type ApplyState (RebaseChange prim) = ApplyState prim
type ApplyState (RebaseFixup prim) # |
Instance details Defined in Darcs.Patch.Rebase.Fixup type ApplyState (RebaseFixup prim) = ApplyState prim
type ApplyState (RepoPatchV1 prim) # |
Instance details Defined in Darcs.Patch.V1.Apply type ApplyState (RepoPatchV1 prim) = ApplyState prim
type ApplyState (RepoPatchV2 prim) # |
Instance details Defined in Darcs.Patch.V2.RepoPatch type ApplyState (RepoPatchV2 prim) = ApplyState prim
type ApplyState (FL p) # |
Instance details Defined in Darcs.Patch.Apply type ApplyState (FL p) = ApplyState p
type ApplyState (RL p) # |
Instance details Defined in Darcs.Patch.Apply type ApplyState (RL p) = ApplyState p
type ApplyState (WrappedNamed rt p) # |
Instance details Defined in Darcs.Patch.Named.Wrapped type ApplyState (WrappedNamed rt p) = ApplyState p
type ApplyState (PatchInfoAndG rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd type ApplyState (PatchInfoAndG rt p) = ApplyState p
type ApplyState (PrimWithName name p) # |
Instance details Defined in Darcs.Patch.Prim.WithName type ApplyState (PrimWithName name p) = ApplyState p
type ApplyState (RepoPatchV3 name prim) # |
Instance details Defined in Darcs.Patch.V3.Core type ApplyState (RepoPatchV3 name prim) = ApplyState prim

rmfile :: PrimConstruct prim => AnchoredPath -> prim wX wY #

addfile :: PrimConstruct prim => AnchoredPath -> prim wX wY #

rmdir :: PrimConstruct prim => AnchoredPath -> prim wX wY #

adddir :: PrimConstruct prim => AnchoredPath -> prim wX wY #

move :: PrimConstruct prim => AnchoredPath -> AnchoredPath -> prim wX wY #

hunk :: PrimConstruct prim => AnchoredPath -> Int -> [ByteString] -> [ByteString] -> prim wX wY #

tokreplace :: PrimConstruct prim => AnchoredPath -> String -> String -> String -> prim wX wY #

anonymous :: FromPrim p => FL (PrimOf p) wX wY -> IO (Named p wX wY) #

binary :: PrimConstruct prim => AnchoredPath -> ByteString -> ByteString -> prim wX wY #

description :: ShowPatch p => p wX wY -> Doc #

showContextPatch :: (ShowContextPatch p, ApplyMonad (ApplyState p) m) => ShowPatchFor -> 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.

data ShowPatchFor #

Constructors

ForDisplay |
ForStorage |

showPatch :: ShowPatchBasic p => ShowPatchFor -> p wX wY -> Doc #

displayPatch :: ShowPatchBasic p => p wX wY -> Doc #

content :: ShowPatch p => p wX wY -> Doc #

infopatch :: forall p wX wY. FromPrim p => PatchInfo -> FL (PrimOf 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 -> [AnchoredPath] #

hunkMatches :: PatchInspect p => (ByteString -> Bool) -> p wX wY -> Bool #

forceTokReplace :: String -> ByteString -> ByteString -> ByteString -> ByteString #

`forceTokReplace tokChars old new input` replaces all occurrences of the `old` token with the `new` one, throughout the `input`.

type PrimPatch prim = (Apply prim, CleanMerge prim, Commute prim, Invert prim, Eq2 prim, IsHunk prim, PatchInspect prim, RepairToFL prim, Show2 prim, PrimConstruct prim, PrimCanonize prim, PrimClassify prim, PrimDetails prim, PrimApply prim, PrimSift prim, PrimMangleUnravelled prim, ReadPatch prim, ShowPatch prim, ShowContextPatch prim, PatchListFormat prim) #

# for PatchTest

resolveConflicts :: Conflict p => RL p wO wX -> RL p wX wY -> [ConflictDetails (PrimOf p) wY] #

The first parameter is a context containing all patches preceding the ones for which we want to calculate the conflict resolution, which is the second parameter. Each element of the result list represents the resolution of one maximal set of transitively conflicting alternatives, in other words, a connected subset of the conflict graph. But the elements themselves must not conflict with each other, guaranteeing that they can be cleanly merged into a single `FL` of prims.

class Effect p #

Patches whose concrete effect can be expressed as a list of primitive patches.

A minimal definition would be either of `effect` or `effectRL`.

Minimal complete definition

effect

#### Instances

Instances details

Effect p => Effect (Named p) # |
Instance details Defined in Darcs.Patch.Named Methods effect :: Named p wX wY -> FL (PrimOf (Named p)) wX wY #
Effect p => Effect (WithDroppedDeps p) # |
Instance details Defined in Darcs.Patch.Rebase.Change Methods effect :: WithDroppedDeps p wX wY -> FL (PrimOf (WithDroppedDeps p)) wX wY #
PrimPatch prim => Effect (RepoPatchV1 prim) # |
Instance details Defined in Darcs.Patch.V1.Commute Methods effect :: RepoPatchV1 prim wX wY -> FL (PrimOf (RepoPatchV1 prim)) wX wY #
PrimPatch prim => Effect (RepoPatchV2 prim) # |
Instance details Defined in Darcs.Patch.V2.RepoPatch Methods effect :: RepoPatchV2 prim wX wY -> FL (PrimOf (RepoPatchV2 prim)) wX wY #
Effect p => Effect (FL p) # |
Instance details Defined in Darcs.Patch.Effect Methods effect :: FL p wX wY -> FL (PrimOf (FL p)) wX wY #
Effect p => Effect (RL p) # |
Instance details Defined in Darcs.Patch.Effect Methods effect :: RL p wX wY -> FL (PrimOf (RL p)) wX wY #
Effect p => Effect (PatchInfoAndG rt p) # |
Instance details Defined in Darcs.Patch.PatchInfoAnd Methods effect :: PatchInfoAndG rt p wX wY -> FL (PrimOf (PatchInfoAndG rt p)) wX wY #
Effect (RepoPatchV3 name prim) # |
Instance details Defined in Darcs.Patch.V3.Core Methods effect :: RepoPatchV3 name prim wX wY -> FL (PrimOf (RepoPatchV3 name prim)) wX wY #

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 #

dropInverses :: (Invert p, Eq2 p) => FL p wX wY -> Maybe (FL p wX wY) #

Delete the first subsequence of patches that is followed by an inverse subsequence, if one exists. If not return `Nothing`.

commuteFL :: Commute p => (p :> FL p) wX wY -> Maybe ((FL p :> p) wX wY) #

`commuteFL` commutes a single element past a FL.

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 -> Either String (Sealed (p wX)) #

readPatchPartial :: ReadPatch p => ByteString -> Either String (Sealed (p wX), ByteString) #

canonize :: PrimCanonize prim => DiffAlgorithm -> 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 #

`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?

patchname :: Named p wX wY -> String #

patchcontents :: Named p wX wY -> FL p wX wY #

apply :: (Apply p, ApplyMonad (ApplyState p) m) => p wX wY -> m () #

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

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

maybeApplyToTree :: (Apply p, ApplyState p ~ Tree) => p wX wY -> Tree IO -> IO (Maybe (Tree IO)) #

Attempts to apply a given patch to a Tree. If the apply fails, we return Nothing, otherwise we return the updated Tree.

effectOnPaths :: (Apply p, ApplyState p ~ Tree) => p wX wY -> [AnchoredPath] -> [AnchoredPath] #

patch2patchinfo :: Named p wX wY -> PatchInfo #

summary :: ShowPatch p => p wX wY -> Doc #

summaryFL :: ShowPatch p => FL p wX wY -> Doc #

plainSummary :: (Summary e, PrimDetails (PrimOf e)) => e wX wY -> Doc #

xmlSummary :: (Summary p, PrimDetails (PrimOf p)) => p wX wY -> Doc #

plainSummaryPrims :: PrimDetails prim => Bool -> FL prim wX wY -> Doc #

adddeps :: Named p wX wY -> [PatchInfo] -> Named p wX wY #

getdeps :: HasDeps p => p wX wY -> [PatchInfo] #

listConflictedFiles :: (Summary p, PatchInspect (PrimOf p)) => p wX wY -> [AnchoredPath] #

isInconsistent :: Check p => p wX wY -> Maybe Doc #

type RepoPatch p = (AnnotateRP p, Apply p, ApplyState p ~ ApplyState (PrimOf p), Check p, Commute p, Conflict p, Effect p, Eq2 p, FromPrim p, IsHunk p, IsHunk (PrimOf p), Merge p, PatchInspect p, PatchListFormat p, PrimPatchBase p, ReadPatch p, RepairToFL p, ShowContextPatch p, ShowPatch p, Summary p, ToPrim p, Unwind p) #