Safe Haskell | None |
---|---|
Language | Haskell2010 |
Darcs.UI.Flags
- data DarcsFlag
- = Version
- | ExactVersion
- | ListCommands
- | Help
- | ListOptions
- | NoTest
- | Test
- | OnlyChangesToFiles
- | ChangesToAllFiles
- | LeaveTestDir
- | NoLeaveTestDir
- | Timings
- | Debug
- | DebugHTTP
- | Verbose
- | NormalVerbosity
- | Quiet
- | Target String
- | Cc String
- | Output AbsolutePathOrStd
- | OutputAutoName AbsolutePath
- | Subject String
- | InReplyTo String
- | Charset String
- | SendmailCmd String
- | Author String
- | SelectAuthor
- | PatchName String
- | OnePatch String
- | SeveralPatch String
- | OneHash String
- | AfterPatch String
- | UpToPatch String
- | AfterHash String
- | UpToHash String
- | TagName String
- | LastN Int
- | MaxCount Int
- | PatchIndexRange Int Int
- | NumberPatches
- | OneTag String
- | AfterTag String
- | UpToTag String
- | GenContext
- | Context AbsolutePath
- | Count
- | LogFile AbsolutePath
- | RmLogFile
- | DontRmLogFile
- | DistName String
- | DistZip
- | All
- | Recursive
- | NoRecursive
- | Minimize
- | NoMinimize
- | Reorder
- | NoReorder
- | RestrictPaths
- | DontRestrictPaths
- | AskDeps
- | NoAskDeps
- | IgnoreTimes
- | DontIgnoreTimes
- | LookForAdds
- | NoLookForAdds
- | LookForMoves
- | NoLookForMoves
- | LookForReplaces
- | NoLookForReplaces
- | UseMyersDiff
- | UsePatienceDiff
- | Intersection
- | Union
- | Complement
- | Sign
- | SignAs String
- | NoSign
- | SignSSL String
- | HappyForwarding
- | NoHappyForwarding
- | Verify AbsolutePath
- | VerifySSL AbsolutePath
- | RemoteDarcsOpt String
- | EditDescription
- | NoEditDescription
- | Toks String
- | EditLongComment
- | NoEditLongComment
- | PromptLongComment
- | KeepDate
- | NoKeepDate
- | AllowConflicts
- | MarkConflicts
- | NoAllowConflicts
- | SkipConflicts
- | Boring
- | SkipBoring
- | AllowCaseOnly
- | DontAllowCaseOnly
- | AllowWindowsReserved
- | DontAllowWindowsReserved
- | DontGrabDeps
- | DontPromptForDependencies
- | PromptForDependencies
- | Compress
- | NoCompress
- | UnCompress
- | WorkRepoDir String
- | WorkRepoUrl String
- | RemoteRepo String
- | NewRepo String
- | NotInRemote (Maybe String)
- | Reply String
- | ApplyAs String
- | MachineReadable
- | HumanReadable
- | Pipe
- | Interactive
- | DiffCmd String
- | ExternalMerge String
- | Summary
- | NoSummary
- | PauseForGui
- | NoPauseForGui
- | Unified
- | NonUnified
- | Reverse
- | Forward
- | Complete
- | Lazy
- | DiffFlags String
- | XMLOutput
- | ForceReplace
- | OnePattern String
- | SeveralPattern String
- | AfterPattern String
- | UpToPattern String
- | NonApply
- | NonVerify
- | NonForce
- | DryRun
- | SetDefault
- | NoSetDefault
- | Disable
- | SetScriptsExecutable
- | DontSetScriptsExecutable
- | Once
- | Linear
- | Backoff
- | Bisect
- | Hashed
- | UseFormat1
- | UseFormat2
- | UseNoWorkingDir
- | UseWorkingDir
- | Sibling AbsolutePath
- | Files
- | NoFiles
- | Directories
- | NoDirectories
- | Pending
- | NoPending
- | PosthookCmd String
- | NoPosthook
- | AskPosthook
- | RunPosthook
- | PrehookCmd String
- | NoPrehook
- | AskPrehook
- | RunPrehook
- | UMask String
- | StoreInMemory
- | ApplyOnDisk
- | NoHTTPPipelining
- | Packs
- | NoPacks
- | NoCache
- | AllowUnrelatedRepos
- | Check
- | Repair
- | JustThisRepo
- | ReadMarks String
- | WriteMarks String
- | NullFlag
- | NoAmendUnrecord
- | AmendUnrecord
- | PatchIndexFlag
- | NoPatchIndexFlag
- compression :: Config -> Compression
- remoteDarcs :: Config -> RemoteDarcs
- reorder :: Config -> Reorder
- minimize :: Config -> Bool
- editDescription :: Config -> Bool
- diffingOpts :: Config -> (UseIndex, ScanKnown, DiffAlgorithm)
- diffOpts :: UseIndex -> LookForAdds -> Bool -> DiffAlgorithm -> (UseIndex, ScanKnown, DiffAlgorithm)
- externalMerge :: Config -> ExternalMerge
- wantGuiPause :: Config -> WantGuiPause
- isInteractive :: Config -> Bool
- maxCount :: Config -> Maybe Int
- willRemoveLogFile :: Config -> Bool
- isUnified :: Config -> WithContext
- doHappyForwarding :: Config -> Bool
- includeBoring :: Config -> Bool
- doAllowCaseOnly :: Config -> Bool
- doAllowWindowsReserved :: Config -> Bool
- doReverse :: Config -> Bool
- usePacks :: Config -> Bool
- showChangesOnlyToFiles :: Config -> Bool
- removeFromAmended :: Config -> Bool
- toMatchFlags :: Config -> [MatchFlag]
- verbosity :: Config -> Verbosity
- useCache :: Config -> UseCache
- umask :: Config -> UMask
- dryRun :: Config -> DryRun
- lookForAdds :: Config -> LookForAdds
- lookForMoves :: Config -> LookForMoves
- lookForReplaces :: Config -> LookForReplaces
- diffAlgorithm :: Config -> DiffAlgorithm
- runTest :: Config -> RunTest
- testChanges :: Config -> TestChanges
- setScriptsExecutable :: Config -> SetScriptsExecutable
- withWorkingDir :: Config -> WithWorkingDir
- leaveTestDir :: Config -> LeaveTestDir
- remoteRepos :: Config -> RemoteRepos
- setDefault :: Bool -> Config -> SetDefault
- cloneKind :: Config -> CloneKind
- workRepo :: Config -> WorkRepo
- allowConflicts :: Config -> AllowConflicts
- runPatchIndex :: Config -> WithPatchIndex
- useIndex :: Config -> UseIndex
- hasSummary :: Summary -> Config -> Summary
- hasXmlOutput :: Config -> XmlOutput
- selectDeps :: Config -> SelectDeps
- hasAuthor :: Config -> Maybe String
- hasLogfile :: Config -> Maybe AbsolutePath
- patchFormat :: Config -> PatchFormat
- 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
- getCharset :: Config -> Maybe String
- getInReplyTo :: Config -> Maybe String
- getCc :: Config -> String
- environmentHelpSendmail :: ([String], [String])
- siblings :: Config -> [AbsolutePath]
- getOutput :: Config -> FilePath -> Maybe AbsolutePathOrStd
- getDate :: Bool -> IO String
- getReply :: Config -> Maybe String
- applyAs :: Config -> Maybe String
Documentation
data DarcsFlag
The DarcsFlag
type is a list of all flags that can ever be
passed to darcs, or to one of its commands.
Constructors
compression :: Config -> Compression
remoteDarcs :: Config -> RemoteDarcs
editDescription :: Config -> Bool
diffingOpts :: Config -> (UseIndex, ScanKnown, DiffAlgorithm)
diffOpts :: UseIndex -> LookForAdds -> Bool -> DiffAlgorithm -> (UseIndex, ScanKnown, DiffAlgorithm)
Non-trivial interaction between options.
externalMerge :: Config -> ExternalMerge
wantGuiPause :: Config -> WantGuiPause
This will become dis-entangled as soon as we inline these functions.
isInteractive :: Config -> Bool
Non-trivial interaction between options. Explicit -i
or -a
dominates,
else --count
, --xml
, or --dry-run
imply -a
, else default to interactive.
willRemoveLogFile :: Config -> Bool
isUnified :: Config -> WithContext
doHappyForwarding :: Config -> Bool
includeBoring :: Config -> Bool
doAllowCaseOnly :: Config -> Bool
doAllowWindowsReserved :: Config -> Bool
showChangesOnlyToFiles :: Config -> Bool
removeFromAmended :: Config -> Bool
toMatchFlags :: Config -> [MatchFlag]
lookForAdds :: Config -> LookForAdds
lookForMoves :: Config -> LookForMoves
lookForReplaces :: Config -> LookForReplaces
diffAlgorithm :: Config -> DiffAlgorithm
testChanges :: Config -> TestChanges
setScriptsExecutable :: Config -> SetScriptsExecutable
withWorkingDir :: Config -> WithWorkingDir
leaveTestDir :: Config -> LeaveTestDir
remoteRepos :: Config -> RemoteRepos
setDefault :: Bool -> Config -> SetDefault
allowConflicts :: Config -> AllowConflicts
runPatchIndex :: Config -> WithPatchIndex
hasSummary :: Summary -> Config -> Summary
hasXmlOutput :: Config -> XmlOutput
selectDeps :: Config -> SelectDeps
hasLogfile :: Config -> Maybe AbsolutePath
patchFormat :: Config -> PatchFormat
fixRemoteRepos :: AbsolutePath -> Config -> IO Config
Ugly. The alternative is to put the remoteRepos accessor into the IO monad, which is hardly better.
fixUrl :: AbsolutePath -> String -> IO String
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]
fixSubPaths files
returns the SubPath
s for the paths in files
that
are inside the repository, preserving their order. Paths in files
that are
outside the repository directory are not in the result.
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 omit the path from the result.
It is intended for validating file arguments to darcs commands.
maybeFixSubPaths :: (AbsolutePath, AbsolutePath) -> [FilePath] -> IO [Maybe SubPath]
maybeFixSubPaths files
tries to turn the file paths in its argument into
SubPath
s.
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
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
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
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]
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
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]
environmentHelpEmail :: ([String], [String])
getSubject :: Config -> Maybe String
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
getCharset :: Config -> Maybe String
getInReplyTo :: Config -> Maybe String
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])
siblings :: Config -> [AbsolutePath]
flagsToSiblings
collects the contents of all Sibling
flags in a list of flags.
getOutput :: Config -> FilePath -> Maybe AbsolutePathOrStd
Accessor for output option