License | GPL-2 |
---|---|
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
A set of functions to identify and find Darcs repositories
from a given URL
or a given filesystem path.
Synopsis
- maybeIdentifyRepository :: UseCache -> String -> IO (IdentifyRepo 'RO p wU wR)
- identifyRepository :: UseCache -> String -> IO (Repository 'RO p wU wR)
- identifyRepositoryFor :: ReadingOrWriting -> Repository rt p wU wR -> UseCache -> String -> IO (Repository 'RO p vR vU)
- data IdentifyRepo rt p wU wR
- = BadRepository String
- | NonRepository String
- | GoodRepository (Repository rt p wU wR)
- data ReadingOrWriting
- findRepository :: WorkRepo -> IO (Either String ())
- amInRepository :: WorkRepo -> IO (Either String ())
- amNotInRepository :: WorkRepo -> IO (Either String ())
- amInHashedRepository :: WorkRepo -> IO (Either String ())
- seekRepo :: IO (Maybe (Either String ()))
Documentation
maybeIdentifyRepository :: UseCache -> String -> IO (IdentifyRepo 'RO p wU wR) Source #
Try to identify the repository at a given location, passed as a String
.
If the lcation is ".", then we assume we are identifying the local repository.
Otherwise we assume we are dealing with a remote repo, which could be a URL
or an absolute path.
identifyRepository :: UseCache -> String -> IO (Repository 'RO p wU wR) Source #
identifyRepository identifies the repo at url
. Warning:
you have to know what kind of patches are found in that repo.
identifyRepositoryFor :: ReadingOrWriting -> Repository rt p wU wR -> UseCache -> String -> IO (Repository 'RO p vR vU) Source #
identifyRepositoryFor repo url
identifies (and returns) the repo at url
,
but fails if it is not compatible for reading from and writing to.
data IdentifyRepo rt p wU wR Source #
The status of a given directory: is it a darcs repository?
BadRepository String | looks like a repository with some error |
NonRepository String | safest guess |
GoodRepository (Repository rt p wU wR) |
seekRepo :: IO (Maybe (Either String ())) Source #
hunt upwards for the darcs repository This keeps changing up one parent directory, testing at each step if the current directory is a repository or not. The result is: Nothing, if no repository found Just (Left errorMessage), if bad repository found Just (Right ()), if good repository found. WARNING this changes the current directory for good if matchFn succeeds