| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Darcs.Repository.Format
- newtype RepoFormat = RF [[RepoProperty]]
- data RepoProperty
- identifyRepoFormat :: String -> IO RepoFormat
- tryIdentifyRepoFormat :: String -> IO (Either String RepoFormat)
- createRepoFormat :: Bool -> WithWorkingDir -> RepoFormat
- writeRepoFormat :: RepoFormat -> FilePath -> IO ()
- writeProblem :: RepoFormat -> Maybe String
- readProblem :: RepoFormat -> Maybe String
- transferProblem :: RepoFormat -> RepoFormat -> Maybe String
- formatHas :: RepoProperty -> RepoFormat -> Bool
- addToFormat :: RepoProperty -> RepoFormat -> RepoFormat
- removeFromFormat :: RepoProperty -> RepoFormat -> RepoFormat
Documentation
newtype RepoFormat Source
Representation of the format of a repository. Each sublist corresponds to a line in the format file. Currently all lines are expected to be singleton words.
Constructors
| RF [[RepoProperty]] |
Instances
data RepoProperty Source
Instances
identifyRepoFormat :: String -> IO RepoFormat Source
Identify the format of the repository at the given location (directory, URL, or SSH path). Fails if we weren't able to identify the format.
tryIdentifyRepoFormat :: String -> IO (Either String RepoFormat) Source
Identify the format of the repository at the
given location (directory, URL, or SSH path).
Return if it fails, where Left reasonreason explains why
we weren't able to identify the format. Note that we do no verification of
the format, which is handled by readProblem or writeProblem on the
resulting RepoFormat.
createRepoFormat :: Bool -> WithWorkingDir -> RepoFormat Source
createRepoFormat useFormat1 useNoWorkingDir create a repo format
writeRepoFormat :: RepoFormat -> FilePath -> IO () Source
Write the repo format to the given file.
writeProblem :: RepoFormat -> Maybe String Source
writeProblem form tells if we can write to a repo in format form,
first checking if we can read that repo It returns Nothing if there's no
problem writing to such a repository.
readProblem :: RepoFormat -> Maybe String Source
returns readProblem sourceJust an error message if we cannot read
from a repo in format source, or Nothing if there's no such problem.
transferProblem :: RepoFormat -> RepoFormat -> Maybe String Source
returns transferProblem source targetJust an error message if we
cannot transfer patches from a repo in format source to a repo in format
target, or Nothing if there are no such problem.
formatHas :: RepoProperty -> RepoFormat -> Bool Source
Is a given property contained within a given format?
addToFormat :: RepoProperty -> RepoFormat -> RepoFormat Source
Add a single property to an existing format.
removeFromFormat :: RepoProperty -> RepoFormat -> RepoFormat Source
Remove a single property from an existing format.