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

Safe Haskell | None
Language | Haskell2010

Darcs.Repository.Pending

Synopsis

- readPending :: forall (p :: Type -> Type -> Type) (rt :: AccessType) wU wR. RepoPatch p => Repository rt p wU wR -> IO (Sealed (FL (PrimOf p) wR))
- readTentativePending :: forall (p :: Type -> Type -> Type) wU wR. RepoPatch p => Repository 'RW p wU wR -> IO (Sealed (FL (PrimOf p) wR))
- writeTentativePending :: forall (p :: Type -> Type -> Type) wU wR wP. RepoPatch p => Repository 'RW p wU wR -> FL (PrimOf p) wR wP -> IO ()
- siftForPending :: forall (prim :: Type -> Type -> Type) wX wY. (PrimCoalesce prim, PrimSift prim) => FL prim wX wY -> Sealed (FL prim wX)
- tentativelyRemoveFromPW :: forall (p :: Type -> Type -> Type) wR wO wP wU. RepoPatch p => Repository 'RW p wU wR -> FL (PrimOf p) wO wR -> FL (PrimOf p) wO wP -> FL (PrimOf p) wP wU -> IO ()
- revertPending :: forall (p :: Type -> Type -> Type) wU wR. RepoPatch p => Repository 'RO p wU wR -> IO ()
- finalizePending :: forall (p :: Type -> Type -> Type) wU wR. Repository 'RW p wU wR -> IO ()
- setTentativePending :: forall (p :: Type -> Type -> Type) wU wR wP. RepoPatch p => Repository 'RW p wU wR -> FL (PrimOf p) wR wP -> IO ()

# Documentation

readPending :: forall (p :: Type -> Type -> Type) (rt :: AccessType) wU wR. RepoPatch p => Repository rt p wU wR -> IO (Sealed (FL (PrimOf p) wR)) #

Read the contents of pending.

readTentativePending :: forall (p :: Type -> Type -> Type) wU wR. RepoPatch p => Repository 'RW p wU wR -> IO (Sealed (FL (PrimOf p) wR)) #

Read the contents of tentative pending.

writeTentativePending :: forall (p :: Type -> Type -> Type) wU wR wP. RepoPatch p => Repository 'RW p wU wR -> FL (PrimOf p) wR wP -> IO () #

Write the contents of tentative pending.

siftForPending :: forall (prim :: Type -> Type -> Type) wX wY. (PrimCoalesce prim, PrimSift prim) => FL prim wX wY -> Sealed (FL prim wX) #

Simplify the candidate pending patch through a combination of looking for self-cancellations (sequences of patches followed by their inverses), coalescing, and getting rid of any hunk or binary patches we can commute out the back.

More abstractly, for an argument `p`, pristine state `R`, and working state `U`, define

    unrecorded p = p +>+ diff (pureApply p R) U

Then the resulting sequence `p'` must maintain that equality, i.e.

    unrecorded p = unrecorded (siftForPending p)

while trying to "minimize" `p`.

tentativelyRemoveFromPW :: forall (p :: Type -> Type -> Type) wR wO wP wU. RepoPatch p => Repository 'RW p wU wR -> FL (PrimOf p) wO wR -> FL (PrimOf p) wO wP -> FL (PrimOf p) wP wU -> IO () #

Remove as much as possible of the given list of prim patches from the pending patch. It is used by record and amend to update pending.

The "as much as possible" is due to --look-for-* options which cause changes that normally must be explicitly done by the user (such as add, move, and replace) to be inferred from the the diff between pristine and working. Also, before we present prims to the user to select for recording, we coalesce prims from pending and working, which is reason we have to use decoalescing.

revertPending :: forall (p :: Type -> Type -> Type) wU wR. RepoPatch p => Repository 'RO p wU wR -> IO () #

Copy the pending patch to the tentative pending, or write a new empty tentative pending if regular pending does not exist.

finalizePending :: forall (p :: Type -> Type -> Type) wU wR. Repository 'RW p wU wR -> IO () #

Replace the pending patch with the tentative pending

setTentativePending :: forall (p :: Type -> Type -> Type) wU wR wP. RepoPatch p => Repository 'RW p wU wR -> FL (PrimOf p) wR wP -> IO () #

Overwrites the pending patch with a new one, starting at the tentative state.