vcswrapper-0.1.6: Wrapper for source code management systems

Safe HaskellNone
LanguageHaskell98

VCSWrapper.Mercurial

Description

 

Synopsis

Documentation

addremove Source #

Arguments

:: [FilePath]

files to add

-> Ctx () 

Add all new files, delete all missing files. Executes hg addremove.

commit Source #

Arguments

:: [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 :: Ctx () Source #

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.

push :: Ctx () Source #

Push changesets from the local repository to the default destination.

simpleLog Source #

Arguments

:: Maybe Text

Show the specified revision or range or branch

-> Ctx [LogEntry] 

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.

status :: Ctx [Status] Source #

Show changed files in the working directory as a list of Status. Executes hg status.

runVcs Source #

Arguments

:: Config

Config for a VCS

-> Ctx t

An operation running in Ctx

-> IO t 

Run a VCS Ctx from a Config and returns the result

data VCSType Source #

Available VCS types implemented in this package.

Constructors

SVN 
GIT 
Mercurial 

type IsLocked = Bool Source #

True, if this file is locked by the VCS.

data LogEntry Source #

Represents a log entry in the history managed by the VCS.

Constructors

LogEntry 

Fields

newtype Ctx a Source #

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

Constructors

Ctx (ReaderT Config IO a) 

Instances

Monad Ctx Source # 

Methods

(>>=) :: Ctx a -> (a -> Ctx b) -> Ctx b #

(>>) :: Ctx a -> Ctx b -> Ctx b #

return :: a -> Ctx a #

fail :: String -> Ctx a #

Functor Ctx Source # 

Methods

fmap :: (a -> b) -> Ctx a -> Ctx b #

(<$) :: a -> Ctx b -> Ctx a #

Applicative Ctx Source # 

Methods

pure :: a -> Ctx a #

(<*>) :: Ctx (a -> b) -> Ctx a -> Ctx b #

(*>) :: Ctx a -> Ctx b -> Ctx b #

(<*) :: Ctx a -> Ctx b -> Ctx a #

MonadIO Ctx Source # 

Methods

liftIO :: IO a -> Ctx a #

MonadReader Config Ctx Source # 

Methods

ask :: Ctx Config #

local :: (Config -> Config) -> Ctx a -> Ctx a #

reader :: (Config -> a) -> Ctx a #

data Config Source #

Configuration of the Ctx the VCS commands will be executed in.

Constructors

Config 

Fields

  • configCwd :: Maybe FilePath

    Path to the main directory of the repository. E.g. for Git: the directory of the repository containing the .git config directory.

  • configPath :: Maybe FilePath

    Path to the vcs executable. If Nothing, the PATH environment variable will be search for a matching executable.

  • configAuthor :: Maybe Author

    Author to be used for different VCS actions. If Nothing, the default for the selected repository will be used.

  • configEnvironment :: [(Text, Text)]

    List of environment variables mappings passed to the underlying VCS executable.

data Author Source #

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.

Constructors

VCSException Int Text Text FilePath [Text]

Exit code -> stdout -> errout -> configCwd of the Config -> List containing the executed command and its options

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.

makeConfig Source #

Arguments

:: Maybe FilePath

Path to the main directory of the repository. E.g. for Git: the directory of the repository containing the .git config directory.

-> Maybe FilePath

Path to the vcs executable. If Nothing, the PATH environment variable will be search for a matching executable.

-> Maybe Author

Author to be used for different VCS actions. If Nothing, the default for the selected repository will be used.

-> Config 

Creates a new Config.

makeConfigWithEnvironment Source #

Arguments

:: Maybe FilePath

Path to the main directory of the repository. E.g. for Git: the directory of the repository containing the .git config directory.

-> Maybe FilePath

Path to the vcs executable. If Nothing, the PATH environment variable will be search for a matching executable.

-> Maybe Author

Author to be used for different VCS actions. If Nothing, the default for the selected repository will be used.

-> [(Text, Text)]

List of environment variables mappings passed to the underlying VCS executable.

-> Config 

Creates a new Config with a list of environment variables.

filePath :: Status -> FilePath Source #

Retrieve the FilePath of any VCS Status.

isLocked :: Status -> IsLocked Source #

Retrieve the IsLocked of any VCS Status. For Git, this returns always False.