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

Darcs.Repository.Pending

Synopsis

Documentation

readPending :: RepoPatch p => Repository rt p wU wR -> IO (Sealed (FL (PrimOf p) wR)) Source #

Read the contents of pending.

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

Read the contents of tentative pending.

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

Write the contents of tentative pending.

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

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 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 () Source #

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 :: RepoPatch p => Repository 'RO p wU wR -> IO () Source #

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

finalizePending :: Repository 'RW p wU wR -> IO () Source #

Replace the pending patch with the tentative pending

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

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