darcs-2.18.2: a distributed, interactive, smart revision control system

License | GPL-2
Safe Haskell | None
Language | Haskell2010

Darcs.Repository.Identify

Description

A set of functions to identify and find Darcs repositories from a given `URL` or a given filesystem path.

Synopsis

- maybeIdentifyRepository :: forall (p :: Type -> Type -> Type) wU wR. UseCache -> String -> IO (IdentifyRepo 'RO p wU wR)
- identifyRepository :: forall (p :: Type -> Type -> Type) wU wR. UseCache -> String -> IO (Repository 'RO p wU wR)
- identifyRepositoryFor :: forall (rt :: AccessType) (p :: Type -> Type -> Type) wU wR vR vU. ReadingOrWriting -> Repository rt p wU wR -> UseCache -> String -> IO (Repository 'RO p vR vU)
- data IdentifyRepo (rt :: AccessType) (p :: Type -> Type -> Type) wU wR
  - = BadRepository String
  - | NonRepository String
  - | GoodRepository (Repository rt p wU wR)
- data ReadingOrWriting
  - = Reading
  - | Writing
- 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 :: forall (p :: Type -> Type -> Type) wU wR. UseCache -> String -> IO (IdentifyRepo 'RO p wU wR) #

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 :: forall (p :: Type -> Type -> Type) wU wR. UseCache -> String -> IO (Repository 'RO p wU wR) #

identifyRepository identifies the repo at `url`. Warning: you have to know what kind of patches are found in that repo.

identifyRepositoryFor :: forall (rt :: AccessType) (p :: Type -> Type -> Type) wU wR vR vU. ReadingOrWriting -> Repository rt p wU wR -> UseCache -> String -> IO (Repository 'RO p vR vU) #

`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 :: AccessType) (p :: Type -> Type -> Type) wU wR #

The status of a given directory: is it a darcs repository?

Constructors

BadRepository String | looks like a repository with some error
NonRepository String | safest guess
GoodRepository (Repository rt p wU wR) |

data ReadingOrWriting #

Constructors

Reading |
Writing |

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 ())) #

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