HsSVN-0.4.3.1: Partial Subversion (SVN) 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 -> ByteString -> 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
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 a new file; use makeFile to create an empty file first.
-> Maybe StringThe hex MD5 digest for the new content. It is ignored if Nothing. But if it's not Nothing, it must match the checksum of the content or applyText throws an error.
-> String

The new content.

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

-> Txn ()
applyText replaces the content of file.
applyTextLBS :: FilePath -> Maybe String -> ByteString -> Txn ()
applyTextLBS does the same thing as applyText but takes Data.ByteString.Lazy.ByteString 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 empty file named fpath. The file is initially empty and 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 the file fromPath in a revision fromRevNum to toPath in the transaction.
Produced by Haddock version 2.6.0