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

Safe Haskell | Safe-Inferred
Language | Haskell2010

Darcs.Repository.Pristine

Synopsis

- data ApplyDir
  - = ApplyNormal
  - | ApplyInverted
- applyToHashedPristine :: (Apply p, ApplyState p ~ Tree) => ApplyDir -> PristineHash -> p wX wY -> IO PristineHash
- applyToTentativePristine :: (ApplyState q ~ Tree, Apply q, ShowPatch q) => Repository rt p wR wU wT -> ApplyDir -> Verbosity -> q wT wY -> IO ()
- applyToTentativePristineCwd :: (ApplyState p ~ Tree, Apply p) => ApplyDir -> p wX wY -> IO ()
- readHashedPristineRoot :: Repository rt p wR wU wT -> IO (Maybe PristineHash)
- pokePristineHash :: PristineHash -> ByteString -> Doc
- peekPristineHash :: ByteString -> PristineHash
- createPristineDirectoryTree :: Repository rt p wR wU wT -> FilePath -> WithWorkingDir -> IO ()
- createPartialsPristineDirectoryTree :: Repository rt p wR wU wT -> [AnchoredPath] -> FilePath -> IO ()
- withRecorded :: Repository rt p wR wU wT -> ((AbsolutePath -> IO a) -> IO a) -> (AbsolutePath -> IO a) -> IO a
- withTentative :: Repository rt p wR wU wT -> ((AbsolutePath -> IO a) -> IO a) -> (AbsolutePath -> IO a) -> IO a

# Documentation

data ApplyDir #

Constructors

ApplyNormal |
ApplyInverted |

applyToHashedPristine :: (Apply p, ApplyState p ~ Tree) => ApplyDir -> PristineHash -> p wX wY -> IO PristineHash #

`applyToHashedPristine` takes a root hash, a patch `p` and attempts to apply the patch to the `Tree` identified by `h`. If we encounter an old, size-prefixed pristine, we first convert it to the non-size-prefixed format, then apply the patch.

applyToTentativePristine :: (ApplyState q ~ Tree, Apply q, ShowPatch q) => Repository rt p wR wU wT -> ApplyDir -> Verbosity -> q wT wY -> IO () #

applyToTentativePristine applies a patch `p` to the tentative pristine tree, and updates the tentative pristine hash

applyToTentativePristineCwd :: (ApplyState p ~ Tree, Apply p) => ApplyDir -> p wX wY -> IO () #

readHashedPristineRoot :: Repository rt p wR wU wT -> IO (Maybe PristineHash) #

readHashedPristineRoot attempts to read the pristine hash from the current inventory, returning Nothing if it cannot do so.

pokePristineHash :: PristineHash -> ByteString -> Doc #

Replace the pristine hash at the start of a raw, unparsed `HeadInventory` or add it if none is present.

peekPristineHash :: ByteString -> PristineHash #

createPristineDirectoryTree :: Repository rt p wR wU wT -> FilePath -> WithWorkingDir -> IO () #

grab the pristine hash of _darcs/hash_inventory, and retrieve whole pristine tree, possibly writing a clean working tree in the process.

createPartialsPristineDirectoryTree :: Repository rt p wR wU wT -> [AnchoredPath] -> FilePath -> IO () #

Used by the commands dist and diff

withRecorded :: Repository rt p wR wU wT -> ((AbsolutePath -> IO a) -> IO a) -> (AbsolutePath -> IO a) -> IO a #

withTentative :: Repository rt p wR wU wT -> ((AbsolutePath -> IO a) -> IO a) -> (AbsolutePath -> IO a) -> IO a #