License | GPL-2 |
---|---|
Safe Haskell | None |
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 wR wU wT -> IO Bool
- canUsePatchIndex :: Repository rt p wR wU wT -> IO Bool
- createPIWithInterrupt :: (RepoPatch p, ApplyState p ~ Tree) => Repository rt p wR wU wT -> PatchSet rt p Origin wR -> IO ()
- createOrUpdatePatchIndexDisk :: (RepoPatch p, ApplyState p ~ Tree) => Repository rt p wR wU wT -> PatchSet rt p Origin wR -> IO ()
- deletePatchIndex :: FilePath -> IO ()
- attemptCreatePatchIndex :: (RepoPatch p, ApplyState p ~ Tree) => Repository rt p wR wU wT -> PatchSet rt p Origin wR -> IO ()
- type PatchFilter rt p = [AnchoredPath] -> [Sealed2 (PatchInfoAnd rt p)] -> IO [Sealed2 (PatchInfoAnd rt p)]
- maybeFilterPatches :: (RepoPatch p, ApplyState p ~ Tree) => Repository rt p wR wU wT -> PatchSet rt p Origin wR -> PatchFilter rt p
- getRelevantSubsequence :: (RepoPatch p, ApplyState p ~ Tree, a ~ PatchInfoAnd rt p) => Sealed (RL a wK) -> Repository rt p wR wU wR -> PatchSet rt 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 wR wU wT -> IO Bool Source #
Checks if patch-index exists and is in sync with repository (more precisely with _darcs/hashed_inventory
).
That is, checks if patch-index can be used as it is now.
canUsePatchIndex :: Repository rt p wR wU wT -> 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 wR wU wT -> PatchSet rt 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 wR wU wT -> PatchSet rt 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 wR wU wT -> PatchSet rt p Origin wR -> IO () Source #
Checks if patch index can be created and build it with interrupt.
type PatchFilter rt p = [AnchoredPath] -> [Sealed2 (PatchInfoAnd rt p)] -> IO [Sealed2 (PatchInfoAnd rt p)] Source #
:: (RepoPatch p, ApplyState p ~ Tree) | |
=> Repository rt p wR wU wT | The repository |
-> PatchSet rt p Origin wR | PatchSet of patches of repository (in case patch-index needs to be created) |
-> PatchFilter rt 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 rt p) | |
=> Sealed (RL a wK) | Sequence of patches you want to filter |
-> Repository rt p wR wU wR | The repository (to attempt loading patch-index from its path) |
-> PatchSet rt 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.