vcswrapper-0.0.3: Wrapper for source code management systems

Safe HaskellNone

VCSWrapper.Svn

Description

Provides high level SVN functions like commit, checkout, update and others.

All functions of this module run in the Ctx monad, common to all VCS. On unexpected behavior, these functions will throw a VCSException. All functions will be executed with options --non-interactive and --no-auth-cache set.

Synopsis

Documentation

addSource

Arguments

:: [FilePath]

files to add

-> Maybe String

optional password

-> [String]

options

-> Ctx () 

Put files and directories under version control, scheduling them for addition to repository. They will be added in next commit.. Executes svn add.

checkoutSource

Arguments

:: [(String, Maybe String)]

list of (url, Maybe revision). List must not be empty, however revision need not to be set

-> Maybe String

optional path

-> Maybe String

optional password

-> [String]

options

-> Ctx () 

Checkout out a working copy from a repository. Executes svn checkout.

commitSource

Arguments

:: [FilePath]

files to commit. List may be empty - if not only specified files will be commited

-> String

message, can be empty

-> Maybe String

optional password

-> [String]

options

-> Ctx () 

Send changes from your working copy to the repository. Executes svn commit.

lockSource

Arguments

:: [FilePath]

Files to lock, must not be empty

-> Maybe String

optional password

-> [String]

options

-> Ctx () 

Lock working copy paths or URLs in the repository, so that no other user can commit changes to them. Executes svn lock.

mergeHeadToRevisionSource

Arguments

:: Integer

revision, e.g. 3

-> Maybe String

optional password

-> [String]

options

-> Ctx () 

Reverts working copy to given revision. Executes svn merge -rHEAD:$revision ..

resolvedSource

Arguments

:: [FilePath]

files or directories to mark resolved

-> Maybe String

optional password

-> [String]

options

-> Ctx () 

Remove conflicted state on working copy files or directories. Executes svn resolved.

simpleLog :: Ctx [LogEntry]Source

Get the log messages for the current working copy. Executes svn log.

unlockSource

Arguments

:: [FilePath]

Files to unlock, must not be empty

-> Maybe String

optional password

-> [String]

options

-> Ctx () 

Unlock working copy paths or URLs. Executes svn unlock.

updateSource

Arguments

:: Maybe String

optional password

-> [String]

options

-> Ctx () 

Bring changes from the repository into the working copy. Executes svn update.

status :: Ctx [Status]Source

Get the status of working copy files and directories. Executes svn status.

getFilesInConflictSource

Arguments

:: FilePath

FilePath to file of conflict.

-> Ctx [FilePath] 

Returns all files of a conflict indicated by its associated filename. E.g. for file Types.hs this might be Types.hs, Types.hs.r1, Types.hs.r2 and Types.hs.mine

runVcsSource

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 = BoolSource

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

mbBranch :: Maybe String

Maybe Branchname

commitID :: String

Commit identifier

author :: String

Author of this commit.

email :: String

Email address of the author.

date :: String

Date this log entry was created.

subject :: String

Short commit message.

body :: String

Long body of the commit message.

Instances

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) 

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 :: [(String, String)]

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

authorName :: String

Name of the author.

authorEmail :: Maybe String

Email address of the author.

Instances

data VCSException Source

This Exception-type will be thrown if a VCS command fails unexpectedly.

Constructors

VCSException Int String String String [String]

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

data Status Source

Status of a file managed by the respective VCS.

Instances

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.

makeConfigSource

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.

makeConfigWithEnvironmentSource

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.

-> [(String, String)]

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

-> Config 

Creates a new Config with a list of environment variables.

filePath :: Status -> FilePathSource

Retrieve the FilePath of any VCS Status.

isLocked :: Status -> IsLockedSource

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