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

Safe Haskell | None
Language | Haskell2010

Darcs.Util.Tree.Hashed

Contents

- Obtaining Trees.
- Writing trees.
- Interact with hashed tree
- Other

Description

A few darcs-specific utility functions. These are used for reading and writing darcs and darcs-compatible hashed trees.

Synopsis

- readDarcsHashed :: Cache -> PristineHash -> IO (Tree IO)
- writeDarcsHashed :: Tree IO -> Cache -> IO PristineHash
- hashedTreeIO :: TreeIO a -> Tree IO -> Cache -> IO (a, Tree IO)
- readDarcsHashedNosize :: Cache -> PristineHash -> IO (Tree IO)
- darcsAddMissingHashes :: Monad m => Tree m -> m (Tree m)
- darcsTreeHash :: forall (m :: Type -> Type). Tree m -> Hash
- darcsUpdateHashes :: Monad m => Tree m -> m (Tree m)
- followPristineHashes :: Cache -> [PristineHash] -> IO [PristineHash]

# Obtaining Trees.

Please note that Trees obtained this way will contain Stub items. These need to be executed (they are IO actions) in order to be accessed. Use `expand` to do this. However, many operations are perfectly fine to be used on a stubbed Tree (and it is often more efficient to do everything that can be done before expanding a Tree).

readDarcsHashed :: Cache -> PristineHash -> IO (Tree IO) #

# Writing trees.

writeDarcsHashed :: Tree IO -> Cache -> IO PristineHash #

Write a Tree into a darcs-style hashed directory.

# Interact with hashed tree

hashedTreeIO #

Arguments

:: TreeIO a | action
-> Tree IO | initial
-> Cache |
-> IO (a, Tree IO) |

Run a `TreeIO` `action` in a hashed setting. Any changes will be written out to the cache. Please note that actual filesystem files are never removed.

# Other

readDarcsHashedNosize :: Cache -> PristineHash -> IO (Tree IO) #

darcsAddMissingHashes :: Monad m => Tree m -> m (Tree m) #

darcsTreeHash :: forall (m :: Type -> Type). Tree m -> Hash #

Compute a darcs-compatible hash value for a tree-like structure.

darcsUpdateHashes :: Monad m => Tree m -> m (Tree m) #

followPristineHashes :: Cache -> [PristineHash] -> IO [PristineHash] #

Return all `PristineHash`es reachable from the given root set, which must consist of directory hashes only.