HsSVN-0.1: (Part of) Subversion binding for HaskellContentsIndex
Subversion.FileSystem.Transaction
Contents
Type
Accessing transaction property
Changing content of file
Changing node property
Creating, deleting and copying entry
Description
An interface to functions that work on a filesystem transaction.
Synopsis
data Txn a
getTxnProp :: String -> Txn (Maybe String)
getTxnPropList :: Txn [(String, String)]
setTxnProp :: String -> Maybe String -> Txn ()
applyText :: FilePath -> Maybe String -> String -> Txn ()
applyTextLBS :: FilePath -> Maybe String -> LazyByteString -> Txn ()
setNodeProp :: FilePath -> String -> Maybe String -> Txn ()
makeFile :: FilePath -> Txn ()
makeDirectory :: FilePath -> Txn ()
deleteEntry :: FilePath -> Txn ()
copyEntry :: RevNum -> FilePath -> FilePath -> Txn ()
Type
data Txn a
Txn a is a FS monad which reads and updates data in filesystem and finally returns a. See MonadFS.
show/hide Instances
Functor Txn
Monad Txn
MonadFS Txn
Accessing transaction property
getTxnProp :: String -> Txn (Maybe String)
getTxnProp propName returns the value of the property named propName on the transaction.
getTxnPropList :: Txn [(String, String)]
getTxnPropList returns the entire property list on the transaction.
setTxnProp :: String -> Maybe String -> Txn ()
setTxnProp propName propValue changes, adds or deletes a property on the transaction.
Changing content of file
applyText
:: FilePathThe file to be replaced. If it does not exist in the transaction, applyText throws an error. That is, you can't use this action to create new files; use makeFile to create an empty file first.
-> Maybe StringThe hex MD5 digest for the new content. It is ignored if Nothing, but if not Nothing, it must match the checksum of the content; if it doesn't, applyText throws an error.
-> String

The new content.

This argument is currently a String but someday it may be changed to [Word8] or something alike. See getFileContents.

-> Txn ()
applyText replaces the content of file.
applyTextLBS :: FilePath -> Maybe String -> LazyByteString -> Txn ()
applyTextLBS does the same thing as applyText but takes LazyByteString instead.
Changing node property
setNodeProp :: FilePath -> String -> Maybe String -> Txn ()
setNodeProp fpath propName propValue changes, adds or deletes a property named propName on file fpath.
Creating, deleting and copying entry
makeFile :: FilePath -> Txn ()
makeFile fpath creates a new file named fpath. The initial content of file is the empty string, and it has no properties.
makeDirectory :: FilePath -> Txn ()
makeDirectory fpath creates a new directory named fpath. The new directory has no entries, and no properties.
deleteEntry :: FilePath -> Txn ()

deleteEntry fpath delete the node named fpath in the transaction. If the node being deleted is a directory, its contents will be deleted recursively.

If the fpath is missing from the transaction, deleteEntry throws an error.

Attempting to remove the root directory also results in an error, even if the directory is empty.

copyEntry :: RevNum -> FilePath -> FilePath -> Txn ()
copyEntry fromRevNum fromPath toPath creates a copy of file fromPath in a revision fromRevNum named toPath in the transaction.
Produced by Haddock version 0.8