| Safe Haskell | None |
|---|
VCSWrapper.Common
Description
This module exports types and functions common to all VCS.
- data VCSType
- type IsLocked = Bool
- data LogEntry = LogEntry {}
- newtype Ctx a = Ctx (ReaderT Config IO a)
- data Config = Config {
- configCwd :: Maybe FilePath
- configPath :: Maybe FilePath
- configAuthor :: Maybe Author
- configEnvironment :: [(String, String)]
- data Author = Author {}
- data VCSException = VCSException Int String String String [String]
- data Status
- data Modification
- makeConfig :: Maybe FilePath -> Maybe FilePath -> Maybe Author -> Config
- makeConfigWithEnvironment :: Maybe FilePath -> Maybe FilePath -> Maybe Author -> [(String, String)] -> Config
- filePath :: Status -> FilePath
- modification :: Status -> Modification
- isLocked :: Status -> IsLocked
- runVcs :: Config -> Ctx t -> IO t
- vcsExec :: String -> String -> [String] -> [(String, String)] -> Ctx (Either VCSException String)
- vcsExecThrowingOnError :: String -> String -> [String] -> [(String, String)] -> Ctx String
- exec :: String -> [String] -> [(String, String)] -> String -> (Config -> Maybe FilePath) -> Ctx (Either VCSException String)
Documentation
Available VCS types implemented in this package.
Represents a log entry in the history managed by the VCS.
Constructors
| LogEntry | |
Context for all VCS commands.
E.g. to create a new Git repository use something like this:
import VCSWrapper.Git
myInitRepoFn = do
let config = makeConfig "path/to/repo" Nothing Nothing
runVcs config $ initDB False
Configuration of the Ctx the VCS commands will be executed in.
Constructors
| Config | |
Fields
| |
Author to be passed to VCS commands where applicable.
Constructors
| Author | |
Fields
| |
data VCSException Source
This Exception-type will be thrown if a VCS command fails unexpectedly.
Status of a file managed by the respective VCS.
Constructors
| SVNStatus FilePath Modification IsLocked | |
| GITStatus FilePath Modification |
data Modification Source
Flags to describe the state of a file.
Constructors
| None | File hasn't been modified. |
| Added | File has been selected to be managed by the respective VCS. |
| Conflicting | File is in conflicting state. Manually resolving the conflict may be necessary. |
| Deleted | File has been deleted. |
| Modified | File has been modified since last commit. |
| Replaced | File has been replaced by a different file. |
| Untracked | File is currently not known by the VCS. |
| Unknown | State of file is unknown. |
| Ignored | File is ignored by VCS. |
| Missing | File is missing. |
Instances
Arguments
| :: Maybe FilePath | Path to the main directory of the repository. E.g. for Git: the directory of the repository containing the |
| -> Maybe FilePath | Path to the vcs executable. If |
| -> Maybe Author | Author to be used for different VCS actions. If |
| -> Config |
Creates a new Config.
makeConfigWithEnvironmentSource
Arguments
| :: Maybe FilePath | Path to the main directory of the repository. E.g. for Git: the directory of the repository containing the |
| -> Maybe FilePath | Path to the vcs executable. If |
| -> Maybe Author | Author to be used for different VCS actions. If |
| -> [(String, String)] | List of environment variables mappings passed to the underlying VCS executable. |
| -> Config |
Creates a new Config with a list of environment variables.
modification :: Status -> ModificationSource
Retrieve the Modification of any VCS Status.
Arguments
| :: String | VCS shell-command, e.g. git |
| -> String | VCS command, e.g. checkout |
| -> [String] | options |
| -> [(String, String)] | environment variables |
| -> Ctx (Either VCSException String) |
Internal function to execute a VCS command
Arguments
| :: String | VCS shell-command, e.g. git |
| -> String | VCS command, e.g. checkout |
| -> [String] | options |
| -> [(String, String)] | environment variables |
| -> Ctx String |
Internal function to execute a VCS command. Throws an exception if the command fails.