filestore-0.3: Interface for versioning file stores.Source codeContentsIndex
Data.FileStore.Generic
PortabilityGHC 6.10 required
Stabilityalpha
MaintainerJohn MacFarlane <jgm@berkeley.edu>
Description
Generic utility functions for working with filestores.
Synopsis
modify :: Contents a => FileStore -> FilePath -> RevisionId -> Author -> Description -> a -> IO (Either MergeInfo ())
create :: Contents a => FileStore -> FilePath -> Author -> Description -> a -> IO ()
data DI
= F
| S
| B
diff :: FileStore -> FilePath -> Maybe RevisionId -> Maybe RevisionId -> IO [(DI, [String])]
searchRevisions :: FileStore -> Bool -> FilePath -> Description -> IO [Revision]
smartRetrieve :: Contents a => FileStore -> Bool -> FilePath -> Maybe String -> IO a
richDirectory :: FileStore -> FilePath -> IO [(Resource, Either String Revision)]
Documentation
modifySource
:: Contents a
=> FileStoreResource to create.
-> FilePathID of previous revision that is being modified.
-> RevisionIdAuthor of change.
-> AuthorDescription of change.
-> DescriptionContents of resource.
-> a
-> IO (Either MergeInfo ())
Modify a named resource in the filestore. Like save, except that a revision ID must be specified. If the resource has been modified since the specified revision, Left merge information is returned. Otherwise, Right the new contents are saved.
createSource
:: Contents a
=> FileStoreResource to create.
-> FilePathAuthor of change.
-> AuthorDescription of change.
-> DescriptionContents of resource.
-> a
-> IO ()
Like save, but first verify that the resource name is new. If not, throws a ResourceExists error.
data DI Source
Difference Indicator. A value is either from the First list, the Second or from Both.
Constructors
F
S
B
show/hide Instances
diffSource
:: FileStore
-> FilePathResource name to get diff for.
-> Maybe RevisionIdJust old revision ID, or Nothing for empty.
-> Maybe RevisionIdJust oew revision ID, or Nothing for latest.
-> IO [(DI, [String])]
Return a unified diff of two revisions of a named resource. Format of the diff is a list [(DI, [String])], where DI is F (in first document only), S (in second only), or B (in both), and the list is a list of lines (without newlines at the end).
searchRevisionsSource
:: FileStore
-> BoolWhen true the description must match exactly, when false partial hits are allowed.
-> FilePathThe resource to search history for.
-> DescriptionRevision description to search for.
-> IO [Revision]
Return a list of all revisions that are saved with the given description or with a part of this description.
smartRetrieveSource
:: Contents a
=> FileStoreTrue for exact description match, False for partial match.
-> BoolResource name to retrieve.
-> FilePathJust revision ID or description, or Nothing for empty.
-> Maybe String
-> IO a
Try to retrieve a resource from the repository by name and possibly a revision identifier. When retrieving a resource by revision identifier fails this function will try to fetch the latest revision for which the description matches the given string.
richDirectory :: FileStore -> FilePath -> IO [(Resource, Either String Revision)]Source
Like directory, but returns information about the latest revision.
Produced by Haddock version 2.6.0