darcs-2.18.4: a distributed, interactive, smart revision control system
Safe HaskellSafe-Inferred
LanguageHaskell2010

Darcs.Patch.Named

Description

Named patches group a set of changes with meta data (PatchInfo) and explicit dependencies (created using `darcs tag` or using --ask-deps).

While the data constructor NamedP is exported for technical reasons, code outside this modules should (and generally does) treat it as an abstract data type. The only exception is the rebase implementation i.e. the modules under Darcs.Patch.Rebase.

Synopsis

Documentation

data Named p wX wY where 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).

Constructors

NamedP :: !PatchInfo -> ![PatchInfo] -> !(FL p wX wY) -> Named p wX wY 

Instances

Instances details
Apply p => Apply (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

Associated Types

type ApplyState (Named p) :: (Type -> Type) -> Type Source #

Methods

apply :: ApplyMonad (ApplyState (Named p)) m => Named p wX wY -> m () Source #

unapply :: ApplyMonad (ApplyState (Named p)) m => Named p wX wY -> m () Source #

Commute p => Commute (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

Methods

commute :: (Named p :> Named p) wX wY -> Maybe ((Named p :> Named p) wX wY) Source #

(Commute p, Conflict p, Summary p, PrimPatchBase p, PatchListFormat p, ShowPatch p) => Conflict (Named p) Source #

This instance takes care of handling the interaction between conflict resolution and explicit dependencies. A conflict involves a set of two or more patches and the general rule is that the conflict is considered resolved if there is another (later) patch that (transitively) depends on each of the (mutually) conflicting patches.

This principle extends to explicit dependencies between Named patches. In particular, recording a tag has the effect of resolving any as yet unresolved conflicts in a repo.

In general a Named patch contains multiple changes ( a "changeset"). Consider the named patches

  Named A [] a
  Named B [] (b1;b2)
  Named C [] c
  Named D [A,B] _

where, at the RepoPatch level, a conflicts with b1, and c with b2. D depends explicitly on both A and B, so it fully covers the conflict between a and b1 and thus we would be justified to consider that particular conflict as resolved. Unfortunately we cannot detect this at the Named patch level because RepoPatchV1 and V2 have no notion of patch identities. Thus, at the Named level the two underlying conflicts appear as a single large conflict between the three named patches A, B, and C, and this means that patch D does not count as a (partial) resolution (even though it arguably should).

When we decide that a set of conflicting Named patches is resolved, we move the RepoPatches contained in them to the context of the resolution. For all other named patches, we must commute as much of their contents as possible past the ones marked as resolved, using commutation at the RepoPatch level (i.e. ignoring explicit dependencies).

Instance details

Defined in Darcs.Patch.Named

Methods

isConflicted :: Named p wX wY -> Bool Source #

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

(Commute p, Conflict p, Summary p, PrimPatchBase p, PatchListFormat p, ShowPatch p) => Conflict (PatchInfoAnd p) Source # 
Instance details

Defined in Darcs.Patch.PatchInfoAnd

PatchDebug p => PatchDebug (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

Methods

patchDebugDummy :: Named p wX wY -> () Source #

Effect p => Effect (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

Methods

effect :: Named p wX wY -> FL (PrimOf (Named p)) wX wY Source #

IsHunk (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

Methods

isHunk :: Named p wX wY -> Maybe (FileHunk (ObjectIdOfPatch (Named p)) wX wY) Source #

PatchListFormat (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

PrimPatchBase p => PrimPatchBase (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

Associated Types

type PrimOf (Named p) :: Type -> Type -> Type Source #

Ident (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

Methods

ident :: Named p wX wY -> PatchId (Named p) Source #

PatchInspect p => PatchInspect (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

Methods

listTouchedFiles :: Named p wX wY -> [AnchoredPath] Source #

hunkMatches :: (ByteString -> Bool) -> Named p wX wY -> Bool Source #

CleanMerge p => CleanMerge (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

Methods

cleanMerge :: (Named p :\/: Named p) wX wY -> Maybe ((Named p :/\: Named p) wX wY) Source #

Merge p => Merge (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

Methods

merge :: (Named p :\/: Named p) wX wY -> (Named p :/\: Named p) wX wY Source #

HasDeps (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

Methods

getdeps :: Named p wX wY -> [PatchInfo] Source #

(ReadPatch p, PatchListFormat p) => ReadPatch (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

Methods

readPatch' :: Parser (Sealed (Named p wX)) Source #

Check p => Check (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

Methods

isInconsistent :: Named p wX wY -> Maybe Doc Source #

RepairToFL p => Repair (Named p) Source # 
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)) Source #

RepairToFL p => Repair (PatchInfoAnd p) Source # 
Instance details

Defined in Darcs.Patch.PatchInfoAnd

(Apply p, IsHunk p, PatchListFormat p, ObjectId (ObjectIdOfPatch p), ShowContextPatch p) => ShowContextPatch (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

(Summary p, PatchListFormat p, PrimPatchBase p, ShowPatch p) => ShowPatch (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

Methods

content :: Named p wX wY -> Doc Source #

description :: Named p wX wY -> Doc Source #

summary :: Named p wX wY -> Doc Source #

summaryFL :: FL (Named p) wX wY -> Doc Source #

thing :: Named p wX wY -> String Source #

things :: Named p wX wY -> String Source #

(PatchListFormat p, ShowPatchBasic p) => ShowPatchBasic (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

Methods

showPatch :: ShowPatchFor -> Named p wX wY -> Doc Source #

Summary p => Summary (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

(PrimPatchBase p, Unwind p) => Unwind (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

Methods

fullUnwind :: Named p wX wY -> Unwound (PrimOf (Named p)) wX wY Source #

(Commute p, Eq2 p) => Eq2 (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

Methods

unsafeCompare :: Named p wA wB -> Named p wC wD -> Bool Source #

(=\/=) :: Named p wA wB -> Named p wA wC -> EqCheck wB wC Source #

(=/\=) :: Named p wA wC -> Named p wB wC -> EqCheck wA wB Source #

Show2 p => Show2 (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

Methods

showDict2 :: ShowDict (Named p wX wY) Source #

Show2 p => Show2 (PatchInfoAnd p) Source # 
Instance details

Defined in Darcs.Patch.PatchInfoAnd

Methods

showDict2 :: ShowDict (PatchInfoAnd p wX wY) Source #

Show2 p => Show1 (Named p wX) Source # 
Instance details

Defined in Darcs.Patch.Named

Methods

showDict1 :: Dict (Show (Named p wX wX0)) Source #

Show2 p => Show1 (PatchInfoAnd p wX) Source # 
Instance details

Defined in Darcs.Patch.PatchInfoAnd

Methods

showDict1 :: Dict (Show (PatchInfoAnd p wX wX0)) Source #

Show2 p => Show (Named p wX wY) Source # 
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 #

type ApplyState (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

type PrimOf (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

type PrimOf (Named p) = PrimOf p
type PatchId (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

infopatch :: forall p wX wY. FromPrim p => PatchInfo -> FL (PrimOf p) wX wY -> Named p wX wY Source #

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

setinfo :: PatchInfo -> Named p wX wY -> Named p wX wY Source #

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

class HasDeps p where Source #

This slightly ad-hoc class is here so we can call getdeps with patch types that wrap a Named, such as RebaseChange.

Methods

getdeps :: p wX wY -> [PatchInfo] Source #

Instances

Instances details
HasDeps (Named p) Source # 
Instance details

Defined in Darcs.Patch.Named

Methods

getdeps :: Named p wX wY -> [PatchInfo] Source #

HasDeps (RebaseChange prim) Source # 
Instance details

Defined in Darcs.Patch.Rebase.Change

Methods

getdeps :: RebaseChange prim wX wY -> [PatchInfo] Source #

patchname :: Named p wX wY -> String Source #

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

fmapNamed :: (forall wA wB. p wA wB -> q wA wB) -> Named p wX wY -> Named q wX wY Source #

fmapFL_Named :: (FL p wA wB -> FL q wC wD) -> Named p wA wB -> Named q wC wD Source #

data ShowDepsFormat Source #

Instances

Instances details
Eq ShowDepsFormat Source # 
Instance details

Defined in Darcs.Patch.Named

data ShowWhichDeps Source #

Support for rebase

Instances

Instances details
Eq ShowWhichDeps Source # 
Instance details

Defined in Darcs.Patch.Named