darcs-2.18.3: a distributed, interactive, smart revision control system
LicenseGPL-2
Safe HaskellSafe-Inferred
LanguageHaskell2010

Darcs.Repository.Identify

Description

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

Synopsis

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?

Constructors

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