HsSVN-0.1: (Part of) Subversion binding for HaskellContentsIndex
Subversion.Repository
Description
An interface to repository, which is built on top of the filesystem.
Synopsis
data Repository
openRepository :: FilePath -> IO Repository
createRepository :: FilePath -> [(String, Config)] -> [(String, String)] -> IO Repository
deleteRepository :: FilePath -> IO ()
getRepositoryFS :: Repository -> IO FileSystem
doReposTxn :: Repository -> RevNum -> String -> Maybe String -> Txn () -> IO (Either FilePath RevNum)
Documentation
data Repository
Repository is an opaque object representing a Subversion repository.
openRepository :: FilePath -> IO Repository

openRepository fpath opens a Subversion repository at fpath.

It acquires a shared lock on the repository, and the lock will be removed by the garbage collector. If an exclusive lock is present, this blocks until it's gone.

createRepository
:: FilePathWhere to create the repository.
-> [(String, Config)]A list of (categoryName, config) tuples which represents a client configuration. It may be an empty list.
-> [(String, String)]This list is passed to the filesystem. See createFileSystem.
-> IO Repository
createRepository creates a new Subversion repository, building the necessary directory structure, creating filesystem, and so on.
deleteRepository :: FilePath -> IO ()
deleteRepository fpath destroys the Subversion repository at fpath.
getRepositoryFS :: Repository -> IO FileSystem
getRepositoryFS repos returns the filesystem associated with repository repos.
doReposTxn
:: RepositoryThe repository.
-> RevNumAn existing revision number which the transaction bases on.
-> StringThe author name to be recorded as a transaction property.
-> Maybe StringThe log message to be recorded as a transaction property. This value may be Nothing if the message is not yet available. The caller will need to attach one to the transaction at a later time.
-> Txn ()The transaction to be done.
-> IO (Either FilePath RevNum)The result is whether Left conflictPath (if it conflicted) or Right newRevNum (if it didn't).

doReposTxn tries to do the transaction. If it succeeds doReposTxn automatically commits it, but if it throws an exception doReposTxn automatically cancels it and rethrow the exception.

Because conflicts tend to occur more frequently than other errors, they aren't reported as an exception.

Produced by Haddock version 0.8