Safe Haskell | None |
---|---|
Language | Haskell98 |
- addremove :: [FilePath] -> Ctx ()
- commit :: [FilePath] -> Text -> [Text] -> Ctx ()
- pull :: Ctx ()
- push :: Ctx ()
- simpleLog :: Maybe Text -> Ctx [LogEntry]
- update :: Maybe Text -> Ctx ()
- status :: Ctx [Status]
- runVcs :: Config -> Ctx t -> IO t
- 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 :: [(Text, Text)]
- data Author = Author {
- authorName :: Text
- authorEmail :: Maybe Text
- data VCSException = VCSException Int Text Text FilePath [Text]
- data Status
- data Modification
- makeConfig :: Maybe FilePath -> Maybe FilePath -> Maybe Author -> Config
- makeConfigWithEnvironment :: Maybe FilePath -> Maybe FilePath -> Maybe Author -> [(Text, Text)] -> Config
- filePath :: Status -> FilePath
- modification :: Status -> Modification
- isLocked :: Status -> IsLocked
Documentation
Add all new files, delete all missing files. Executes hg addremove
.
:: [FilePath] | files to commit. List may be empty - if not only specified files will be commited |
-> Text | message, can be empty |
-> [Text] | options |
-> Ctx () |
Commit the specified files or all outstanding changes. Executes hg commit
.
Pull changes from a remote repository to a local one. If a merge conflict is detected, the error
message is returned, otherwise 'Right ()' is returned. Executes hg pull
.
Show revision history of entire repository or files. Executes hg log
.
update :: Maybe Text -> Ctx () Source
Update the repository's working directory to the specified changeset. If no changeset is specified, update to the tip of the current named branch.
Show changed files in the working directory as a list of Status
. Executes hg status
.
Available VCS types implemented in this package.
Represents a log entry in the history managed by the VCS.
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.
Config | |
|
Author to be passed to VCS commands where applicable.
Author | |
|
data VCSException Source
This Exception
-type will be thrown if a VCS command fails unexpectedly.
Status of a file managed by the respective VCS.
data Modification Source
Flags to describe the state of a file.
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. |
:: 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
.
makeConfigWithEnvironment Source
:: 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 |
-> [(Text, Text)] | List of environment variables mappings passed to the underlying VCS executable. |
-> Config |
Creates a new Config
with a list of environment variables.
modification :: Status -> Modification Source
Retrieve the Modification
of any VCS Status
.