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

Safe Haskell | None
Language | Haskell2010

Darcs.Repository.Inventory

Synopsis

- module Darcs.Repository.Inventory.Format
- readPatchesFromInventoryFile :: forall (p :: Type -> Type -> Type) (rt :: AccessType) wU wR wS. (PatchListFormat p, ReadPatch p) => FilePath -> Repository rt p wU wR -> IO (PatchSet p Origin wS)
- readPatchesFromInventory :: forall (p :: Type -> Type -> Type). (PatchListFormat p, ReadPatch p) => Cache -> Inventory -> IO (SealedPatchSet p Origin)
- readSinglePatch :: forall (p :: Type -> Type -> Type) wX. ReadPatch p => Cache -> PatchInfo -> PatchHash -> IO (Sealed (p wX))
- readOneInventory :: forall (p :: Type -> Type -> Type) wX. ReadPatch p => Cache -> FilePath -> IO (Sealed (RL (PatchInfoAndG p) wX))
- writeInventory :: forall (p :: Type -> Type -> Type) wX. RepoPatch p => String -> Cache -> PatchSet p Origin wX -> IO InventoryHash
- writePatchIfNecessary :: forall (p :: Type -> Type -> Type) wX wY. RepoPatch p => Cache -> PatchInfoAnd p wX wY -> IO InventoryEntry
- writeHashFile :: ValidHash h => Cache -> Doc -> IO h

# Documentation

module Darcs.Repository.Inventory.Format

readPatchesFromInventoryFile :: forall (p :: Type -> Type -> Type) (rt :: AccessType) wU wR wS. (PatchListFormat p, ReadPatch p) => FilePath -> Repository rt p wU wR -> IO (PatchSet p Origin wS) #

Read a `PatchSet` starting with a specific inventory inside a `Repository`.

readPatchesFromInventory :: forall (p :: Type -> Type -> Type). (PatchListFormat p, ReadPatch p) => Cache -> Inventory -> IO (SealedPatchSet p Origin) #

Read a complete `PatchSet` from a `Cache`, by following the chain of `Inventory`s, starting with the given one.

readSinglePatch :: forall (p :: Type -> Type -> Type) wX. ReadPatch p => Cache -> PatchInfo -> PatchHash -> IO (Sealed (p wX)) #

Read a single patch from a `Cache`, given its `PatchInfo` and `PatchHash`. Fails with an error message if the patch file cannot be parsed.

readOneInventory :: forall (p :: Type -> Type -> Type) wX. ReadPatch p => Cache -> FilePath -> IO (Sealed (RL (PatchInfoAndG p) wX)) #

writeInventory :: forall (p :: Type -> Type -> Type) wX. RepoPatch p => String -> Cache -> PatchSet p Origin wX -> IO InventoryHash #

writePatchIfNecessary :: forall (p :: Type -> Type -> Type) wX wY. RepoPatch p => Cache -> PatchInfoAnd p wX wY -> IO InventoryEntry #

Write a `PatchInfoAnd` to disk and return an `InventoryEntry` i.e. the patch info and hash. However, if we patch already contains a hash, assume it has already been written to disk at some point and merely return the info and hash.

writeHashFile :: ValidHash h => Cache -> Doc -> IO h #

Wrapper around `writeFileUsingCache` that takes a `Doc` instead of a `ByteString`.