module VCSWrapper.Mercurial.Process (
hgExecNoEnv
, hgExec
, module VCSWrapper.Common.Process
) where
import VCSWrapper.Common.Process
import VCSWrapper.Mercurial.Types
import Control.Monad.Reader(ask)
hgExecNoEnv :: String
-> [String]
-> Ctx()
hgExecNoEnv cmd options = do
config <- ask
let mbAuthor = configAuthor config
let opts = (authopts mbAuthor)++options
hgExec cmd opts []
return()
where
authopts Nothing = []
authopts (Just a) = ["--username", authorName a]
hgExec :: String
-> [String]
-> [(String, String)]
-> Ctx String
hgExec cmd opts = do
let extOpts = opts++globalOpts
vcsExecThrowingOnError "hg" cmd extOpts
where
globalOpts = ["--noninteractive"]