darcs-2.16.1: a distributed, interactive, smart revision control system

Darcs.UI.Flags

Contents

Synopsis

# Documentation

data DarcsFlag Source #

The DarcsFlag type is a list of all flags that can ever be passed to darcs, or to one of its commands.

Instances
 Source # Instance detailsDefined in Darcs.UI.Options.Flags Methods Source # Instance detailsDefined in Darcs.UI.Options.Flags MethodsshowList :: [DarcsFlag] -> ShowS #

Non-trivial interaction between options.

This will become dis-entangled as soon as we inline these functions.

Non-trivial interaction between options. Explicit -i or -a dominates, else --count, --xml, or --dry-run imply -a, else use the def argument.

Ugly. The alternative is to put the remoteRepos accessor into the IO monad, which is hardly better. However, accessing the flag list directly here is benign, as we only map over the list and don't change the order.

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.

pathsFromArgs :: (AbsolutePath, AbsolutePath) -> [String] -> IO [AnchoredPath] Source #

Used by commands that expect arguments to be paths in the current repo. Invalid paths are dropped and a warning is issued. This may leave no valid paths to return. Although these commands all fail if there are no remaining valid paths, they do so in various different ways, issuing error messages tailored to the command.

pathSetFromArgs :: (AbsolutePath, AbsolutePath) -> [String] -> IO (Maybe [AnchoredPath]) Source #

Used by commands that interpret a set of optional path arguments as "restrict to these paths", which affects patch selection (e.g. in log command) or selection of subtrees (e.g. in record). Because of the special meaning of "no arguments", we must distinguish it from "no valid arguments". A result of Nothing here means "no restriction to the set of paths". If Just is returned, the set is guaranteed to be non-empty.

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 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 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 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 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 \$SENDMAIL which will be used as a fallback if present.

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

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.

Accessor for output option

# Re-exports

pull, apply, rebase pull, rebase apply

matchAny :: MatchOption Source #

TODO: see issue2395

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.

convert, clone, init