Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data DarcsFlag
- remoteDarcs :: Config -> RemoteDarcs
- diffingOpts :: Config -> (UseIndex, ScanKnown, DiffAlgorithm)
- diffOpts :: UseIndex -> LookForAdds -> IncludeBoring -> DiffAlgorithm -> (UseIndex, ScanKnown, DiffAlgorithm)
- scanKnown :: LookForAdds -> IncludeBoring -> ScanKnown
- wantGuiPause :: Config -> WantGuiPause
- isInteractive :: Bool -> Config -> Bool
- willRemoveLogFile :: Config -> Bool
- includeBoring :: Config -> Bool
- lookForAdds :: Config -> LookForAdds
- lookForMoves :: Config -> LookForMoves
- lookForReplaces :: Config -> LookForReplaces
- setDefault :: Bool -> Config -> SetDefault
- allowConflicts :: Config -> AllowConflicts
- hasXmlOutput :: Config -> Bool
- hasLogfile :: Config -> Maybe AbsolutePath
- quiet :: Config -> Bool
- verbose :: Config -> Bool
- enumeratePatches :: Config -> Bool
- fixRemoteRepos :: AbsolutePath -> Config -> IO Config
- fixUrl :: AbsolutePath -> String -> IO String
- fixSubPaths :: (AbsolutePath, AbsolutePath) -> [FilePath] -> IO [SubPath]
- maybeFixSubPaths :: (AbsolutePath, AbsolutePath) -> [FilePath] -> IO [Maybe SubPath]
- getRepourl :: Config -> Maybe String
- getAuthor :: Maybe String -> Bool -> IO String
- promptAuthor :: Bool -> Bool -> IO String
- getEasyAuthor :: IO [String]
- getSendmailCmd :: Config -> IO String
- fileHelpAuthor :: [String]
- environmentHelpEmail :: ([String], [String])
- getSubject :: Config -> Maybe String
- getInReplyTo :: Config -> Maybe String
- getCc :: Config -> String
- environmentHelpSendmail :: ([String], [String])
- getOutput :: Config -> FilePath -> Maybe AbsolutePathOrStd
- getDate :: Bool -> IO String
- compress :: PrimDarcsOption Compression
- diffAlgorithm :: PrimDarcsOption DiffAlgorithm
- reorder :: PrimDarcsOption Reorder
- minimize :: PrimDarcsOption Bool
- editDescription :: PrimDarcsOption Bool
- externalMerge :: PrimDarcsOption ExternalMerge
- maxCount :: PrimDarcsOption (Maybe Int)
- matchAny :: MatchOption
- withContext :: PrimDarcsOption WithContext
- happyForwarding :: PrimDarcsOption Bool
- allowCaseDifferingFilenames :: PrimDarcsOption Bool
- allowWindowsReservedFilenames :: PrimDarcsOption Bool
- changesReverse :: PrimDarcsOption Bool
- usePacks :: PrimDarcsOption Bool
- onlyToFiles :: PrimDarcsOption Bool
- amendUnrecord :: PrimDarcsOption Bool
- verbosity :: PrimDarcsOption Verbosity
- useCache :: PrimDarcsOption UseCache
- useIndex :: PrimDarcsOption UseIndex
- umask :: PrimDarcsOption UMask
- dryRun :: PrimDarcsOption DryRun
- runTest :: PrimDarcsOption RunTest
- testChanges :: PrimDarcsOption TestChanges
- setScriptsExecutable :: PrimDarcsOption SetScriptsExecutable
- withWorkingDir :: PrimDarcsOption WithWorkingDir
- leaveTestDir :: PrimDarcsOption LeaveTestDir
- remoteRepos :: PrimDarcsOption RemoteRepos
- cloneKind :: PrimDarcsOption CloneKind
- workRepo :: PrimDarcsOption WorkRepo
- patchIndexNo :: PrimDarcsOption WithPatchIndex
- patchIndexYes :: PrimDarcsOption WithPatchIndex
- xmlOutput :: PrimDarcsOption XmlOutput
- selectDeps :: PrimDarcsOption SelectDeps
- author :: PrimDarcsOption (Maybe String)
- reply :: PrimDarcsOption (Maybe String)
- patchFormat :: PrimDarcsOption PatchFormat
- charset :: PrimDarcsOption (Maybe String)
- siblings :: PrimDarcsOption [AbsolutePath]
- applyAs :: PrimDarcsOption (Maybe String)
- enumPatches :: PrimDarcsOption EnumPatches
Documentation
The DarcsFlag
type is a list of all flags that can ever be
passed to darcs, or to one of its commands.
remoteDarcs :: Config -> RemoteDarcs Source #
diffingOpts :: Config -> (UseIndex, ScanKnown, DiffAlgorithm) Source #
diffOpts :: UseIndex -> LookForAdds -> IncludeBoring -> DiffAlgorithm -> (UseIndex, ScanKnown, DiffAlgorithm) Source #
scanKnown :: LookForAdds -> IncludeBoring -> ScanKnown Source #
Non-trivial interaction between options.
wantGuiPause :: Config -> WantGuiPause Source #
This will become dis-entangled as soon as we inline these functions.
isInteractive :: Bool -> Config -> Bool Source #
Non-trivial interaction between options. Explicit -i
or -a
dominates,
else --count
, --xml
, or --dry-run
imply -a
, else use the def argument.
willRemoveLogFile :: Config -> Bool Source #
includeBoring :: Config -> Bool Source #
lookForAdds :: Config -> LookForAdds Source #
lookForMoves :: Config -> LookForMoves Source #
lookForReplaces :: Config -> LookForReplaces Source #
setDefault :: Bool -> Config -> SetDefault Source #
allowConflicts :: Config -> AllowConflicts Source #
hasXmlOutput :: Config -> Bool Source #
hasLogfile :: Config -> Maybe AbsolutePath Source #
enumeratePatches :: Config -> Bool Source #
fixRemoteRepos :: AbsolutePath -> Config -> IO Config Source #
Ugly. The alternative is to put the remoteRepos accessor into the IO monad, which is hardly better.
fixUrl :: AbsolutePath -> String -> IO String Source #
fixUrl
takes a String that may be a file path or a URL.
It returns either the URL, or an absolute version of the path.
fixSubPaths :: (AbsolutePath, AbsolutePath) -> [FilePath] -> IO [SubPath] Source #
fixSubPaths
is a variant of maybeFixSubPaths
that throws out
non-repository paths and duplicates from the result. See there for details.
TODO: why filter out null paths from the input? why here and not in
maybeFixSubPaths
?
maybeFixSubPaths :: (AbsolutePath, AbsolutePath) -> [FilePath] -> IO [Maybe SubPath] Source #
maybeFixSubPaths (repo_path, orig_path) file_paths
tries to turn
file_paths
into SubPath
s, taking into account the repository path and
the original path from which darcs was invoked.
A SubPath
is a path under (or inside) the repo path. This does not
mean it must exist as a file or directory, nor that the path has been added
to the repository; it merely means that it could be added.
When converting a relative path to an absolute one, this function first tries
to interpret the relative path with respect to the current working directory.
If that fails, it tries to interpret it with respect to the repository
directory. Only when that fails does it put a Nothing
in the result at the
position of the path that cannot be converted.
It is intended for validating file arguments to darcs commands.
getRepourl :: Config -> Maybe String Source #
getRepourl
takes a list of flags and returns the url of the
repository specified by Repodir "directory"
in that list of flags, if any.
This flag is present if darcs was invoked with --repodir=DIRECTORY
getAuthor :: Maybe String -> Bool -> IO String Source #
getAuthor
takes a list of flags and returns the author of the
change specified by Author "Leo Tolstoy"
in that list of flags, if any.
Otherwise, if Pipe
is present, asks the user who is the author and
returns the answer. If neither are present, try to guess the author,
from repository or global preference files or environment variables,
and if it's not possible, ask the user.
promptAuthor :: Bool -> Bool -> IO String Source #
promptAuthor
try to guess the author, from repository or
global preference files or environment variables, and
if it's not possible or alwaysAsk parameter is true, ask the user.
If store parameter is true, the new author is added into
_darcs/prefs
.
getEasyAuthor :: IO [String] Source #
getEasyAuthor
tries to get the author name first from the repository preferences,
then from global preferences, then from environment variables. Returns []
if it could not get it. Note that it may only return multiple possibilities when
reading from global preferences
getSendmailCmd :: Config -> IO String Source #
getSendmailCmd
takes a list of flags and returns the sendmail command
to be used by darcs send
. Looks for a command specified by
SendmailCmd "command"
in that list of flags, if any.
This flag is present if darcs was invoked with --sendmail-command=COMMAND
Alternatively the user can set $S
ENDMAIL
which will be used as a fallback if present.
fileHelpAuthor :: [String] Source #
environmentHelpEmail :: ([String], [String]) Source #
getSubject :: Config -> Maybe String Source #
getSubject
takes a list of flags and returns the subject of the mail
to be sent by darcs send
. Looks for a subject specified by
Subject "subject"
in that list of flags, if any.
This flag is present if darcs was invoked with --subject=SUBJECT
getInReplyTo :: Config -> Maybe String Source #
getCc :: Config -> String Source #
getCc
takes a list of flags and returns the addresses to send a copy of
the patch bundle to when using darcs send
.
looks for a cc address specified by Cc "address"
in that list of flags.
Returns the addresses as a comma separated string.
environmentHelpSendmail :: ([String], [String]) Source #
Re-exports
maxCount :: PrimDarcsOption (Maybe Int) Source #
TODO: Returning -1
if the argument cannot be parsed as an integer is
not something I expected to find in a Haskell program. Instead, the flag
should take either a plain String
argument (leaving it to a later stage
to parse the String
to an Int
), or else a
, taking
the possibility of a failed parse into account.Maybe
Int
onlyToFiles :: PrimDarcsOption Bool Source #
TODO: see issue2395
dryRun :: PrimDarcsOption DryRun Source #
TODO someone wrote here long ago that any time --dry-run is a possibility automated users should be able to examine the results more easily with --xml. See also issue2397. dryRun w/o xml is currently used in add, pull, and repair.
withWorkingDir :: PrimDarcsOption WithWorkingDir Source #
convert, clone, init