License | GPL-2 |
---|---|
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
The patch-index stores additional information that is extracted from
the PatchSet for the repository to speed up certain commands (namely
log
and annotate
). More precisely, for every file tracked by the
repository, it stores the list of patches that touch it.
When created, patch-index lives in _darcs/patch_index/
, and it
should be automatically maintained each time the set of patches of
the repository is updated.
Patch-index can also be explicitely disabled by creating a file
_darcs/no_patch_index
. "Explicitely disabed" means that no command
should attempt to automatically create the patch-index.
See http://darcs.net/Internals/PatchIndex for more information.
Synopsis
- doesPatchIndexExist :: FilePath -> IO Bool
- isPatchIndexDisabled :: FilePath -> IO Bool
- isPatchIndexInSync :: Repository rt p wU wR -> IO Bool
- canUsePatchIndex :: Repository rt p wU wR -> IO Bool
- createPIWithInterrupt :: (RepoPatch p, ApplyState p ~ Tree) => Repository rt p wU wR -> PatchSet p Origin wR -> IO ()
- createOrUpdatePatchIndexDisk :: (RepoPatch p, ApplyState p ~ Tree) => Repository rt p wU wR -> PatchSet p Origin wR -> IO ()
- deletePatchIndex :: FilePath -> IO ()
- attemptCreatePatchIndex :: (RepoPatch p, ApplyState p ~ Tree) => Repository rt p wU wR -> PatchSet p Origin wR -> IO ()
- type PatchFilter p = [AnchoredPath] -> [Sealed2 (PatchInfoAnd p)] -> IO [Sealed2 (PatchInfoAnd p)]
- maybeFilterPatches :: (RepoPatch p, ApplyState p ~ Tree) => Repository rt p wU wR -> PatchSet p Origin wR -> PatchFilter p
- getRelevantSubsequence :: (RepoPatch p, ApplyState p ~ Tree, a ~ PatchInfoAnd p) => Sealed (RL a wK) -> Repository rt p wU wR -> PatchSet p Origin wR -> [AnchoredPath] -> IO (Sealed (RL a Origin))
- dumpPatchIndex :: FilePath -> IO ()
- piTest :: FilePath -> IO ()
Documentation
doesPatchIndexExist :: FilePath -> IO Bool Source #
Read-only. Checks if patch-index exists for this repository it works by checking if:
_darcs/patch_index/
and its corresponding files are all present- patch index version is the one handled by this version of Darcs
isPatchIndexDisabled :: FilePath -> IO Bool Source #
Read-only. Checks if _darcs/noPatchIndex
exists, that is, if patch-index is explicitely disabled.
isPatchIndexInSync :: Repository rt p wU wR -> IO Bool Source #
Checks if patch-index exists and is in sync with repository. That is, checks if patch-index can be used as it is now.
canUsePatchIndex :: Repository rt p wU wR -> IO Bool Source #
Read-only. Checks the two following things:
Then only if it exists and it is not explicitely disabled, returns True
, else returns False
(or an error if it exists and is explicitely disabled at the same time).
createPIWithInterrupt :: (RepoPatch p, ApplyState p ~ Tree) => Repository rt p wU wR -> PatchSet p Origin wR -> IO () Source #
Creates patch-index (ignoring whether it is explicitely disabled). If it is ctrl-c'ed, then aborts, delete patch-index and mark it as disabled.
createOrUpdatePatchIndexDisk :: (RepoPatch p, ApplyState p ~ Tree) => Repository rt p wU wR -> PatchSet p Origin wR -> IO () Source #
Create or update patch index
- if
_darcs/no_patch_index
exists, delete it - if patch index exists, update it
- if not, create it from scratch
deletePatchIndex :: FilePath -> IO () Source #
Deletes patch-index (_darcs/patch_index/
and its contents) and mark repository as disabled (creates _darcs/no_patch_index
).
attemptCreatePatchIndex :: (RepoPatch p, ApplyState p ~ Tree) => Repository rt p wU wR -> PatchSet p Origin wR -> IO () Source #
Checks if patch index can be created and build it with interrupt.
type PatchFilter p = [AnchoredPath] -> [Sealed2 (PatchInfoAnd p)] -> IO [Sealed2 (PatchInfoAnd p)] Source #
:: (RepoPatch p, ApplyState p ~ Tree) | |
=> Repository rt p wU wR | The repository |
-> PatchSet p Origin wR | PatchSet of patches of repository (in case patch-index needs to be created) |
-> PatchFilter p | PatchFilter ready to be used by SelectChanges. |
If a patch index is available, returns a filter that takes a list of files
and returns a PatchFilter
that only keeps patches that modify the given
list of files. If patch-index cannot be used, return the original input.
If patch-index does not exist and is not explicitely disabled, silently
create it. (Also, if it is out-of-sync, which should not happen, silently
update it).
getRelevantSubsequence Source #
:: (RepoPatch p, ApplyState p ~ Tree, a ~ PatchInfoAnd p) | |
=> Sealed (RL a wK) | Sequence of patches you want to filter |
-> Repository rt p wU wR | The repository (to attempt loading patch-index from its path) |
-> PatchSet p Origin wR | PatchSet of repository (in case we need to create patch-index) |
-> [AnchoredPath] | File(s) about which you want patches from given sequence |
-> IO (Sealed (RL a Origin)) | Filtered sequence of patches |
Returns an RL in which the order of patches matters. Useful for the
annotate
command. If patch-index does not exist and is not explicitely
disabled, silently create it. (Also, if it is out-of-sync, which should not
happen, silently update it).
dumpPatchIndex :: FilePath -> IO () Source #
Dump information in patch index. Patch-index should be checked to exist beforehand. Read-only.