| Safe Haskell | Safe-Infered |
|---|
Darcs.Repository.Format
- newtype RepoFormat = RF [[RepoProperty]]
- data RepoProperty
- = Darcs1_0
- | Darcs2
- | HashedInventory
- | NoWorkingDir
- | UnknownFormat String
- identifyRepoFormat :: String -> IO RepoFormat
- tryIdentifyRepoFormat :: String -> IO (Either String RepoFormat)
- createRepoFormat :: [DarcsFlag] -> RepoFormat
- writeRepoFormat :: RepoFormat -> FilePath -> IO ()
- writeProblem :: RepoFormat -> Maybe String
- readProblem :: RepoFormat -> Maybe String
- readfromAndWritetoProblem :: RepoFormat -> RepoFormat -> Maybe String
- formatHas :: RepoProperty -> RepoFormat -> Bool
Documentation
newtype RepoFormat
RepoFormat is the representation of the format of a repository. Each
sublist corresponds to a line in the format file.
Constructors
| RF [[RepoProperty]] |
Instances
| Show RepoFormat |
data RepoProperty
Constructors
| Darcs1_0 | |
| Darcs2 | |
| HashedInventory | |
| NoWorkingDir | |
| UnknownFormat String |
Instances
| Eq RepoProperty | |
| Show RepoProperty |
identifyRepoFormat :: String -> IO RepoFormat
identifyRepoFormat URL identifies the format of the repository at the
given address. Fails if we weren't able to identify the format.
tryIdentifyRepoFormat :: String -> IO (Either String RepoFormat)
tryIdentifyRepoFormat URL identifies the format of the repository at the
given address. Return Left reason if it fails, where reason 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 :: [DarcsFlag] -> RepoFormat
Create a repo format, given a list of flags - based on workingdir/format.
writeRepoFormat :: RepoFormat -> FilePath -> IO ()
writeRepoFormat writes the repo format to the given file.
writeProblem :: RepoFormat -> Maybe String
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
readProblem form tells if we can read from a repo in format form.
It returns Nothing if there's no problem reading from such a repository.
readfromAndWritetoProblem :: RepoFormat -> RepoFormat -> Maybe String
readfromAndWritetoProblem form tells if we can read from one and write
to another repo format, returning Nothing if there's no problem.
formatHas :: RepoProperty -> RepoFormat -> Bool
Is a given property contained within a given format?