darcs-2.16.4: a distributed, interactive, smart revision control system
Safe HaskellNone
LanguageHaskell2010

Darcs.Patch.Depends

Description

Definitions used in this module:

Explicit dependencies
The set of patches that a (named) patch depends on "by name", i.e. irrespective of (non-)commutation (non commuting patches are implicit dependencies). The most important example are tags, but non-tag patches can also have explicit dependencies by recording them with --ask-deps.
Covered
A patch p is covered by a tag t if t explicitly depends on p or a tag covered by t explicitly depends on p. In other words, the transitive closure of the relation "is depended on", restricted to situations where the right hand side is a tag. Note that it does not take explicit dependencies of non-tag patches into account at all.
Clean
A tag t in a repository is clean if all patches prior to the tag are covered by t. Tags normally start out as clean tags (the exception is if --ask-deps is used). It typically becomes unclean when it is merged into another repo (here the exceptions are if --reorder-patches is used, or if the target repo is actually a subset of the source repo).
Synopsis

Documentation

getUncovered :: PatchSet rt p wStart wX -> [PatchInfo] Source #

Return the PatchInfo for all the patches in a PatchSet that are not depended on by any tag (in the given PatchSet).

This is exactly the set of patches that a new tag recorded on top of the PatchSet would explicitly depend on.

findCommonAndUncommon :: forall rt p wX wY. Commute p => PatchSet rt p Origin wX -> PatchSet rt p Origin wY -> Fork (PatchSet rt p) (FL (PatchInfoAnd rt p)) (FL (PatchInfoAnd rt p)) Origin wX wY Source #

mergeThem :: (Commute p, Merge p) => PatchSet rt p Origin wX -> PatchSet rt p Origin wY -> Sealed (FL (PatchInfoAnd rt p) wX) Source #

countUsThem :: Commute p => PatchSet rt p Origin wX -> PatchSet rt p Origin wY -> (Int, Int) Source #

removeFromPatchSet :: (Commute p, Eq2 p) => FL (PatchInfoAnd rt p) wX wY -> PatchSet rt p wStart wY -> Maybe (PatchSet rt p wStart wX) Source #

slightlyOptimizePatchset :: PatchSet rt p wStart wX -> PatchSet rt p wStart wX Source #

Create a new Tagged section for the most recent clean tag found in the tail of un-Tagged patches without re-ordering patches. Note that earlier tags may remain un-Tagged even if they are actually clean.

splitOnTag :: Commute p => PatchInfo -> PatchSet rt p wStart wX -> Maybe (PatchSet rt p wStart wX) Source #

Take a tag's PatchInfo, and a PatchSet, and attempt to find the tag in the PatchSet. If found, return a new PatchSet, in which the tag is now clean (and the last of the Tagged list), while all patches that are not covered by the tag are in the trailing list of patches. If the tag is not in the PatchSet, we return Nothing.

findUncommon :: Commute p => PatchSet rt p Origin wX -> PatchSet rt p Origin wY -> (FL (PatchInfoAnd rt p) :\/: FL (PatchInfoAnd rt p)) wX wY Source #

cleanLatestTag :: Commute p => PatchSet rt p wStart wX -> PatchSet rt p wStart wX Source #

Reorder a PatchSet such that the latest tag becomes clean.

contextPatches :: PatchSet rt p wX wY -> (PatchSet rt p :> RL (PatchInfoAnd rt p)) wX wY Source #

Split a PatchSet at the latest clean tag. The left part is what comes before the tag, the right part is the tag and its non-dependencies.