-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | a distributed, interactive, smart revision control system
--
-- Darcs is a free, open source revision control system. It is:
--
--
-- - Distributed: Every user has access to the full command set,
-- removing boundaries between server and client or committer and
-- non-committers.
-- - Interactive: Darcs is easy to learn and efficient to use because
-- it asks you questions in response to simple commands, giving you
-- choices in your work flow. You can choose to record one change in a
-- file, while ignoring another. As you update from upstream, you can
-- review each patch name, even the full diff for interesting
-- patches.
-- - Smart: Originally developed by physicist David Roundy, darcs is
-- based on a unique algebra of patches.
--
--
-- This smartness lets you respond to changing demands in ways that would
-- otherwise not be possible. Learn more about spontaneous branches with
-- darcs.
@package darcs
@version 2.5
module Darcs.Patch.OldDate
-- | Read/interpret a date string, assuming UTC if timezone is not
-- specified in the string
readUTCDate :: String -> CalendarTime
showIsoDateTime :: CalendarTime -> String
module Darcs.Witnesses.Show
data ShowDict a
ShowDictClass :: ShowDict a
ShowDictRecord :: (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> ShowDict a
showD :: ShowDict a -> a -> String
showListD :: ShowDict a -> [a] -> ShowS
showsPrecD :: ShowDict a -> Int -> a -> ShowS
class Show1 a
showDict1 :: (Show1 a) => ShowDict (a)
class Show2 a
showDict2 :: (Show2 a) => ShowDict (a)
show1 :: (Show1 a) => a -> String
showsPrec1 :: (Show1 a) => Int -> a -> ShowS
show2 :: (Show2 a) => a -> String
showsPrec2 :: (Show2 a) => Int -> a -> ShowS
showOp2 :: (Show2 a, Show2 b) => Int -> String -> Int -> a -> b -> String -> String
appPrec :: Int
module Darcs.Patch.RegChars
-- | regChars returns a filter function that tells if a char is a
-- member of the regChar expression or not. The regChar expression is
-- basically a set of chars, but it can contain ranges with use of the
-- - (dash), and it can also be specified as a complement set by
-- prefixing with ^ (caret). The dash and caret, as well as the
-- backslash, can all be escaped with a backslash to suppress their
-- special meaning.
--
-- NOTE: The . (dot) is allowed to be escaped. It has no special
-- meaning if it is not escaped, but the default filename_toks
-- in Darcs.Commands.Replace uses an escaped dot (WHY?).
regChars :: String -> (Char -> Bool)
module Ratified
-- | The readFile function reads a file and returns the contents of
-- the file as a string. The file is read lazily, on demand, as with
-- getContents.
readFile :: FilePath -> IO String
-- | Computation hGetContents hdl returns the list of
-- characters corresponding to the unread portion of the channel or file
-- managed by hdl, which is put into an intermediate state,
-- semi-closed. In this state, hdl is effectively closed,
-- but items are read from hdl on demand and accumulated in a
-- special list returned by hGetContents hdl.
--
-- Any operation that fails because a handle is closed, also fails if a
-- handle is semi-closed. The only exception is hClose. A semi-closed
-- handle becomes closed:
--
--
-- - if hClose is applied to it;
-- - if an I/O error occurs when reading an item from the handle;
-- - or once the entire contents of the handle has been read.
--
--
-- Once a semi-closed handle becomes closed, the contents of the
-- associated list becomes fixed. The contents of this final list is only
-- partially specified: it will contain at least all the items of the
-- stream that were evaluated prior to the handle becoming closed.
--
-- Any I/O errors encountered while a handle is semi-closed are simply
-- discarded.
--
-- This operation may fail with:
--
--
-- - isEOFError if the end of file has been reached.
--
hGetContents :: Handle -> IO String
-- | This modules provides rudimentary natural language generation (NLG)
-- utilities. That is, generating natural language from a machine
-- representation. Initially, only English is supported at all.
-- Representations are implemented for:
--
--
-- - countable nouns (plurality); and * lists of clauses (foo, bar
-- and/or baz).
--
module English
-- |
-- englishNum 0 (Noun "watch") "" == "watches"
-- englishNum 1 (Noun "watch") "" == "watch"
-- englishNum 2 (Noun "watch") "" == "watches"
--
englishNum :: (Countable n) => Int -> n -> ShowS
-- | Things that have a plural and singular spelling
class Countable a
plural :: (Countable a) => a -> ShowS
singular :: (Countable a) => a -> ShowS
-- | This only distinguishes between nouns with a final -ch, and nouns
-- which do not. More irregular nouns will just need to have their own
-- type
--
--
-- plural (Noun "batch") "" == "batches"
-- plural (Noun "bat") "" == "bats"
-- plural (Noun "mouse") "" == "mouses" -- :-(
--
newtype Noun
Noun :: String -> Noun
-- |
-- singular This (Noun "batch") "" == "this batch"
-- plural This (Noun "batch") "" == "these batches"
--
data This
This :: Noun -> This
-- | Given a list of things, combine them thusly:
--
--
-- orClauses ["foo", "bar", "baz"] == "foo, bar or baz"
--
orClauses :: [String] -> String
andClauses :: [String] -> String
-- | As intersperse, with a different separator for the last |
-- interspersal.
intersperseLast :: String -> String -> [String] -> String
presentParticiple :: String -> String
instance Countable This
instance Countable Noun
module Workaround
-- | renameFile old new changes the name of an existing
-- file system object from old to new. If the new
-- object already exists, it is atomically replaced by the old
-- object. Neither path may refer to an existing directory. A conformant
-- implementation need not support renaming files in all situations (e.g.
-- renaming across different physical devices), but the constraints must
-- be documented.
--
-- The operation may fail with:
--
--
-- - HardwareFault A physical I/O error has occurred.
-- [EIO]
-- - InvalidArgument Either operand is not a valid file name.
-- [ENAMETOOLONG, ELOOP]
-- - isDoesNotExistError / NoSuchThing The original file
-- does not exist, or there is no path to the target. [ENOENT,
-- ENOTDIR]
-- - isPermissionError / PermissionDenied The process has
-- insufficient privileges to perform the operation. [EROFS, EACCES,
-- EPERM]
-- - ResourceExhausted Insufficient resources are available to
-- perform the operation. [EDQUOT, ENOSPC, ENOMEM, EMLINK]
-- - UnsatisfiedConstraints Implementation-dependent constraints
-- are not satisfied. [EBUSY]
-- - UnsupportedOperation The implementation does not support
-- renaming in this situation. [EXDEV]
-- - InappropriateType Either path refers to an existing
-- directory. [ENOTDIR, EISDIR, EINVAL, EEXIST, ENOTEMPTY]
--
renameFile :: FilePath -> FilePath -> IO ()
setExecutable :: FilePath -> Bool -> IO ()
-- | If the operating system has a notion of current directories,
-- getCurrentDirectory returns an absolute path to the current
-- directory of the calling process.
--
-- The operation may fail with:
--
--
getCurrentDirectory :: IO FilePath
-- | installHandler int handler iset calls sigaction to
-- install an interrupt handler for signal int. If
-- handler is Default, SIG_DFL is installed;
-- if handler is Ignore, SIG_IGN is installed;
-- if handler is Catch action, a handler is installed
-- which will invoke action in a new thread when (or shortly
-- after) the signal is received. If iset is Just s,
-- then the sa_mask of the sigaction structure is set
-- to s; otherwise it is cleared. The previously installed
-- signal handler for int is returned
installHandler :: Signal -> Handler -> Maybe SignalSet -> IO Handler
-- | raiseSignal int calls kill to signal the current
-- process with interrupt signal int.
raiseSignal :: Signal -> IO ()
-- | The actions to perform when a signal is received.
data Handler :: *
Default :: Handler
Ignore :: Handler
Catch :: IO () -> Handler
CatchOnce :: IO () -> Handler
type Signal = CInt
sigINT :: CInt
sigHUP :: CInt
sigABRT :: CInt
sigALRM :: CInt
sigTERM :: CInt
sigPIPE :: CInt
module Darcs.SignalHandler
withSignalsHandled :: IO a -> IO a
withSignalsBlocked :: IO () -> IO ()
catchInterrupt :: IO a -> IO a -> IO a
catchNonSignal :: IO a -> (SomeException -> IO a) -> IO a
tryNonSignal :: IO a -> IO (Either SomeException a)
stdoutIsAPipe :: IO Bool
instance Typeable SignalException
instance Show SignalException
instance Exception SignalException
module Darcs.Witnesses.Sealed
data Sealed a
Sealed :: a -> Sealed a
seal :: a -> Sealed a
unseal :: (a -> b) -> Sealed a -> b
mapSeal :: (a -> b) -> Sealed a -> Sealed b
unsafeUnseal :: Sealed a -> a
unsafeUnsealFlipped :: FlippedSeal a -> a
unsafeUnseal2 :: Sealed2 a -> a
data Sealed2 a
Sealed2 :: !a -> Sealed2 a
seal2 :: a -> Sealed2 a
unseal2 :: (a -> b) -> Sealed2 a -> b
mapSeal2 :: (a -> b) -> Sealed2 a -> Sealed2 b
data FlippedSeal a
FlippedSeal :: !a -> FlippedSeal a
flipSeal :: a -> FlippedSeal a
unsealFlipped :: (a -> b) -> FlippedSeal a -> b
mapFlipped :: (a -> b) -> FlippedSeal a -> FlippedSeal b
unsealM :: (Monad m) => m (Sealed a) -> (a -> m b) -> m b
liftSM :: (Monad m) => (a -> b) -> m (Sealed a) -> m b
-- | Gap abstracts over FreeLeft and FreeRight for
-- code constructing these values
class Gap w
emptyGap :: (Gap w) => (p) -> w p
freeGap :: (Gap w) => (p) -> w p
joinGap :: (Gap w) => (p -> q -> r) -> w p -> w q -> w r
-- | 'FreeLeft p' is 'forall x . exists y . p x y' In other words the
-- caller is free to specify the left witness, and then the right witness
-- is an existential. Note that the order of the type constructors is
-- important for ensuring that y is dependent on the x
-- that is supplied. This is why Stepped is needed, rather than
-- writing the more obvious 'Sealed (Poly p)' which would notionally have
-- the same quantification of the type witnesses.
data FreeLeft p
-- | Unwrap a FreeLeft value
unFreeLeft :: FreeLeft p -> Sealed (p)
-- | 'FreeLeft p' is 'forall y . exists x . p x y' In other words the
-- caller is free to specify the right witness, and then the left witness
-- is an existential. Note that the order of the type constructors is
-- important for ensuring that x is dependent on the y
-- that is supplied.
data FreeRight p
-- | Unwrap a FreeRight value
unFreeRight :: FreeRight p -> FlippedSeal p
instance Gap FreeRight
instance Gap FreeLeft
instance (Show2 a) => Show (Sealed2 a)
instance (Show1 a) => Show (Sealed a)
module IsoDate
-- | The current time in the format returned by showIsoDateTime
getIsoDateTime :: IO String
-- | Read/interpret a date string, assuming local timezone if not specified
-- in the string
readLocalDate :: String -> CalendarTime
-- | Read/interpret a date string, assuming UTC if timezone is not
-- specified in the string (see readDate) Warning! This errors out
-- if we fail to interpret the date
readUTCDate :: String -> CalendarTime
-- | Parse a date string, assuming a default timezone if the date string
-- does not specify one. The date formats understood are those of
-- showIsoDateTime and dateTime
parseDate :: Int -> String -> Either ParseError MCalendarTime
-- | Return the local timezone offset from UTC in seconds
getLocalTz :: IO Int
-- | In English, either a date followed by a time, or vice-versa, e.g,
--
--
-- - yesterday at noon
-- - yesterday tea time
-- - 12:00 yesterday
--
--
-- See englishDate and englishTime Uses its first argument
-- as now, i.e. the time relative to which yesterday,
-- today etc are to be interpreted
englishDateTime :: CalendarTime -> CharParser a CalendarTime
-- | English expressions for intervals of time,
--
--
-- - before tea time (i.e. from the beginning of time)
-- - after 14:00 last month (i.e. till now)
-- - between last year and last month
-- - in the last three months (i.e. from then till now)
-- - 4 months ago (i.e. till now; see englishAgo)
--
englishInterval :: CalendarTime -> CharParser a TimeInterval
-- | Durations in English that begin with the word "last", E.g. "last 4
-- months" is treated as the duration between 4 months ago and now
englishLast :: CalendarTime -> CharParser a (CalendarTime, CalendarTime)
-- | Intervals in ISO 8601, e.g.,
--
--
-- - 2008-09/2012-08-17T16:30
-- - 2008-09/P2Y11MT16H30M
-- - P2Y11MT16H30M/2012-08-17T16:30
--
--
-- See iso8601Duration
iso8601Interval :: Int -> CharParser a (Either TimeDiff (MCalendarTime, MCalendarTime))
-- | Durations in ISO 8601, e.g.,
--
--
-- - P4Y (four years)
-- - P5M (five months)
-- - P4Y5M (four years and five months)
-- - P4YT3H6S (four years, three hours and six seconds)
--
iso8601Duration :: CharParser a TimeDiff
-- | Convert a date string into ISO 8601 format (yyyymmdd variant) assuming
-- local timezone if not specified in the string Warning! This errors out
-- if we fail to interpret the date
cleanLocalDate :: String -> String
-- | Set a calendar to UTC time any eliminate any inconsistencies within
-- (for example, where the weekday is given as Thursday, but
-- this does not match what the numerical date would lead one to expect)
resetCalendar :: CalendarTime -> CalendarTime
-- | An MCalenderTime is an underspecified CalendarTime It
-- is used for parsing dates. For example, if you want to parse the date
-- '4 January', it may be useful to underspecify the year by setting it
-- to Nothing. This uses almost the same fields as
-- CalendarTime, a notable exception being that we introduce
-- mctWeek to indicate if a weekday was specified or not
data MCalendarTime
MCalendarTime :: Maybe Int -> Maybe Month -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Int -> Maybe Integer -> Maybe Day -> Maybe Int -> Maybe String -> Maybe Int -> Maybe Bool -> Bool -> MCalendarTime
mctYear :: MCalendarTime -> Maybe Int
mctMonth :: MCalendarTime -> Maybe Month
mctDay :: MCalendarTime -> Maybe Int
mctHour :: MCalendarTime -> Maybe Int
mctMin :: MCalendarTime -> Maybe Int
mctSec :: MCalendarTime -> Maybe Int
mctPicosec :: MCalendarTime -> Maybe Integer
mctWDay :: MCalendarTime -> Maybe Day
mctYDay :: MCalendarTime -> Maybe Int
mctTZName :: MCalendarTime -> Maybe String
mctTZ :: MCalendarTime -> Maybe Int
mctIsDST :: MCalendarTime -> Maybe Bool
mctWeek :: MCalendarTime -> Bool
subtractFromMCal :: TimeDiff -> MCalendarTime -> MCalendarTime
addToMCal :: TimeDiff -> MCalendarTime -> MCalendarTime
-- | Trivially convert a CalendarTime to a fully specified
-- MCalendarTime (note that this sets the mctWeek flag to
-- False
toMCalendarTime :: CalendarTime -> MCalendarTime
-- | Returns the first CalendarTime that falls within a
-- MCalendarTime This is only unsafe in the sense that it plugs in
-- default values for fields that have not been set, e.g.
-- January for the month or 0 for the seconds field.
-- Maybe we should rename it something happier. See also
-- resetCalendar
unsafeToCalendarTime :: MCalendarTime -> CalendarTime
-- | Zero the time fields of a CalendarTime
unsetTime :: CalendarTime -> CalendarTime
type TimeInterval = (Maybe CalendarTime, Maybe CalendarTime)
instance Show MCalendarTime
module DateMatcher
-- | parseDateMatcher s return the first matcher in
-- getMatchers that can parse s
parseDateMatcher :: String -> IO (CalendarTime -> Bool)
-- | A DateMatcher combines a potential parse for a date string with
-- a matcher function that operates on a given date. We use an
-- existential type on the matcher to allow the date string to either be
-- interpreted as a point in time or as an interval.
data DateMatcher
DM :: String -> (Either ParseError d) -> (d -> CalendarTime -> Bool) -> DateMatcher
-- | getMatchers d returns the list of matchers that will
-- be applied on d. If you wish to extend the date parsing code,
-- this will likely be the function that you modify to do so.
getMatchers :: String -> IO [DateMatcher]
-- | This was originally Tomasz Zielonka's AtExit module, slightly
-- generalised to include global variables. Here, we attempt to cover
-- broad, global features, such as exit handlers. These features slightly
-- break the Haskellian purity of darcs, in favour of programming
-- convenience.
module Darcs.Global
-- | Registers an IO action to run just before darcs exits. Useful for
-- removing temporary files and directories, for example.
atexit :: IO () -> IO ()
withAtexit :: IO a -> IO a
sshControlMasterDisabled :: Bool
setSshControlMasterDisabled :: IO ()
verboseMode :: Bool
setVerboseMode :: IO ()
timingsMode :: Bool
setTimingsMode :: IO ()
whenDebugMode :: IO () -> IO ()
withDebugMode :: (Bool -> IO a) -> IO a
setDebugMode :: IO ()
debugMessage :: String -> IO ()
debugFail :: String -> IO a
putTiming :: IO ()
addCRCWarning :: FilePath -> IO ()
getCRCWarnings :: IO [FilePath]
resetCRCWarnings :: IO ()
darcsdir :: String
-- | GZIp and MMap IO for ByteStrings, encoding utilities, and
-- miscellaneous functions for Data.ByteString
module ByteStringUtils
-- | Do something with the internals of a PackedString. Beware of altering
-- the contents!
unsafeWithInternals :: ByteString -> (Ptr Word8 -> Int -> IO a) -> IO a
-- | Decodes a ByteString containing UTF-8 to a String.
-- Decoding errors are flagged with the U+FFFD character.
unpackPSFromUTF8 :: ByteString -> String
packStringToUTF8 :: String -> ByteString
-- | Read an entire file, which may or may not be gzip compressed, directly
-- into a ByteString.
gzReadFilePS :: FilePath -> IO ByteString
-- | Like readFilePS, this reads an entire file directly into a
-- ByteString, but it is even more efficient. It involves directly
-- mapping the file to memory. This has the advantage that the contents
-- of the file never need to be copied. Also, under memory pressure the
-- page may simply be discarded, wile in the case of readFilePS it would
-- need to be written to swap. If you read many small files, mmapFilePS
-- will be less memory-efficient than readFilePS, since each mmapFilePS
-- takes up a separate page of memory. Also, you can run into bus errors
-- if the file is modified. NOTE: as with readFilePS, the string
-- representation in the file is assumed to be ISO-8859-1.
mmapFilePS :: FilePath -> IO ByteString
gzWriteFilePS :: FilePath -> ByteString -> IO ()
gzWriteFilePSs :: FilePath -> [ByteString] -> IO ()
-- | Read standard input, which may or may not be gzip compressed, directly
-- into a ByteString.
gzReadStdin :: IO ByteString
isGZFile :: FilePath -> IO (Maybe Int)
-- | Decompress the given bytestring into a lazy list of chunks, along with
-- a boolean flag indicating (if True) that the CRC was corrupted.
-- Inspecting the flag will cause the entire list of chunks to be
-- evaluated (but if you throw away the list immediately this should run
-- in constant space).
gzDecompress :: Maybe Int -> ByteString -> ([ByteString], Bool)
ifHeadThenTail :: Word8 -> ByteString -> Maybe ByteString
-- | dropSpace efficiently returns the ByteString argument
-- with white space Chars removed from the front. It is more efficient
-- than calling dropWhile for removing whitespace. I.e.
--
--
-- dropWhile isSpace == dropSpace
--
dropSpace :: ByteString -> ByteString
-- | breakSpace returns the pair of ByteStrings when the argument is
-- broken at the first whitespace byte. I.e.
--
--
-- break isSpace == breakSpace
--
breakSpace :: ByteString -> (ByteString, ByteString)
linesPS :: ByteString -> [ByteString]
-- | This function acts exactly like the Prelude unlines function,
-- or like Data.ByteString.Char8 unlines, but with one
-- important difference: it will produce a string which may not end with
-- a newline! That is:
--
--
-- unlinesPS ["foo", "bar"]
--
--
-- evaluates to "foo\nbar", not "foo\nbar\n"! This point should hold true
-- for linesPS as well.
--
-- TODO: rename this function.
unlinesPS :: [ByteString] -> ByteString
hashPS :: ByteString -> Int32
breakFirstPS :: Char -> ByteString -> Maybe (ByteString, ByteString)
breakLastPS :: Char -> ByteString -> Maybe (ByteString, ByteString)
substrPS :: ByteString -> ByteString -> Maybe Int
-- | readIntPS skips any whitespace at the beginning of its argument, and
-- reads an Int from the beginning of the PackedString. If there is no
-- integer at the beginning of the string, it returns Nothing, otherwise
-- it just returns the int read, along with a B.ByteString containing the
-- remainder of its input.
readIntPS :: ByteString -> Maybe (Int, ByteString)
isFunky :: ByteString -> Bool
fromHex2PS :: ByteString -> ByteString
fromPS2Hex :: ByteString -> ByteString
-- | betweenLinesPS returns the B.ByteString between the two lines given,
-- or Nothing if they do not appear.
betweenLinesPS :: ByteString -> ByteString -> ByteString -> Maybe (ByteString)
breakAfterNthNewline :: Int -> ByteString -> Maybe (ByteString, ByteString)
breakBeforeNthNewline :: Int -> ByteString -> (ByteString, ByteString)
-- | O(n) The intercalate function takes a ByteString
-- and a list of ByteStrings and concatenates the list after
-- interspersing the first argument between each element of the list.
intercalate :: ByteString -> [ByteString] -> ByteString
-- | Decode a ByteString to a String according to the current locale
-- unsafePerformIO in the locale function is ratified by the fact that
-- GHC 6.12 and above also supply locale conversion with functions with a
-- pure type. Unrecognized byte sequences in the input are skipped.
decodeLocale :: ByteString -> String
-- | Encode a String to a ByteString according to the current locale
encodeLocale :: String -> ByteString
-- | Encode a String to a ByteString with latin1 (i.e., the values of the
-- characters become the values of the bytes; if a character value is
-- greater than 255, its byte becomes the character value modulo 256)
encodeLatin1 :: String -> ByteString
-- | Take a String that represents byte values and re-decode it
-- acording to the current locale.
decodeString :: String -> String
-- | Convert a bytestring representing a text from UTF-8 to the current
-- locale
utf8ToLocale :: ByteString -> ByteString
-- | FileName is an abstract type intended to facilitate the input and
-- output of unicode filenames.
module Darcs.Patch.FileName
data FileName
fp2fn :: FilePath -> FileName
fn2fp :: FileName -> FilePath
fn2ps :: FileName -> ByteString
ps2fn :: ByteString -> FileName
niceps2fn :: ByteString -> FileName
fn2niceps :: FileName -> ByteString
breakOnDir :: FileName -> Maybe (FileName, FileName)
normPath :: FileName -> FileName
ownName :: FileName -> FileName
superName :: FileName -> FileName
movedirfilename :: FileName -> FileName -> FileName -> FileName
-- | encodeWhite translates whitespace in filenames to a
-- darcs-specific format (numerical representation according to
-- ord surrounded by backslashes). Note that backslashes are also
-- escaped since they are used in the encoding.
--
--
-- encodeWhite "hello there" == "hello\32\there"
-- encodeWhite "hello\there" == "hello\92\there"
--
encodeWhite :: FilePath -> String
-- | decodeWhite interprets the Darcs-specific "encoded" filenames
-- produced by encodeWhite
--
--
-- decodeWhite "hello\32\there" == "hello there"
-- decodeWhite "hello\92\there" == "hello\there"
-- decodeWhite "hello\there" == error "malformed filename"
--
decodeWhite :: String -> FilePath
(///) :: FileName -> FileName -> FileName
-- | Split a file path at the slashes
breakup :: String -> [String]
instance Eq FileName
instance Ord FileName
instance Show FileName
-- | This module defines our parsing monad. In the past there have been
-- lazy and strict parsers in this module. Currently we have only the
-- strict variant and it is used for parsing patch files.
module Darcs.Patch.ReadMonads
class (Monad m) => ParserM m
work :: (ParserM m) => (ByteString -> Maybe (a, ByteString)) -> m a
maybeWork :: (ParserM m) => (ByteString -> Maybe (a, ByteString)) -> m (Maybe a)
peekInput :: (ParserM m) => m ByteString
-- | Applies a function to the input stream and discards the result of the
-- function.
alterInput :: (ParserM m) => (ByteString -> ByteString) -> m ()
-- | parseStrictly applies the parser functions to a string and
-- checks that each parser produced a result as it goes. The strictness
-- is in the ParserM instance for SM.
parseStrictly :: SM a -> ByteString -> Maybe (a, ByteString)
-- | lexChar checks if the next space delimited token from the input
-- stream matches a specific Char. Uses Maybe inside
-- ParserM to handle failed matches, so that it always returns ()
-- on success.
lexChar :: (ParserM m) => Char -> m ()
-- | lexString fetches the next whitespace delimited token from from
-- the input and checks if it matches the String input. Uses
-- Maybe inside ParserM to handle failed matches, so that
-- it always returns () on success.
lexString :: (ParserM m) => String -> m ()
-- | Checks if any of the input Strings match the next space
-- delimited token in the input stream. Uses Maybe inside
-- ParserM to handle failed matches, on success it returns the
-- matching String.
lexStrings :: (ParserM m) => [String] -> m String
-- | lexEof looks for optional spaces followed by the end of input.
-- Uses Maybe inside ParserM to handle failed matches, so
-- that it always returns () on success.
lexEof :: (ParserM m) => m ()
-- | myLex drops leading spaces and then breaks the string at the
-- next space. Returns Nothing when the string is empty after
-- dropping leading spaces, otherwise it returns the first sequence of
-- non-spaces and the remainder of the input.
myLex :: ByteString -> Maybe (ByteString, ByteString)
instance ParserM SM
instance Monad SM
module Darcs.Patch.MatchData
data PatchMatch
PatternMatch :: String -> PatchMatch
patchMatch :: String -> PatchMatch
instance Eq PatchMatch
instance Show PatchMatch
module Progress
-- | beginTedious k starts a tedious process and registers it in
-- _progressData with the key k. A tedious process is one
-- for which we want a progress indicator.
--
-- Wouldn't it be safer if it had type String -> IO ProgressDataKey,
-- so that we can ensure there is no collision? What happens if you call
-- beginTedious twice with the same string, without calling endTedious in
-- the meantime?
beginTedious :: String -> IO ()
-- | endTedious k unregisters the tedious process with key
-- k, printing Done if such a tedious process exists.
endTedious :: String -> IO ()
tediousSize :: String -> Int -> IO ()
debugMessage :: String -> IO ()
debugFail :: String -> IO a
withoutProgress :: IO a -> IO a
progress :: String -> a -> a
progressKeepLatest :: String -> a -> a
finishedOne :: String -> String -> a -> a
finishedOneIO :: String -> String -> IO ()
progressList :: String -> [a] -> [a]
minlist :: Int
setProgressMode :: Bool -> IO ()
module Exec
exec :: String -> [String] -> Redirects -> IO ExitCode
execInteractive :: String -> String -> IO ExitCode
withoutNonBlock :: IO a -> IO a
type Redirects = (Redirect, Redirect, Redirect)
data Redirect
AsIs :: Redirect
Null :: Redirect
File :: FilePath -> Redirect
Stdout :: Redirect
data ExecException
ExecException :: String -> [String] -> Redirects -> String -> ExecException
instance Typeable ExecException
instance Show ExecException
instance Show Redirect
instance Exception ExecException
module Printer
-- | A Printable is either a String, a packed string, or a chunk of
-- text with both representations.
data Printable
S :: !String -> Printable
PS :: !ByteString -> Printable
Both :: !String -> !ByteString -> Printable
-- | a Doc is a bit of enriched text. Docs get concatanated
-- using <>, which is right-associative.
newtype Doc
Doc :: (St -> Document) -> Doc
unDoc :: Doc -> St -> Document
type Printers = Handle -> Printers'
-- | A set of printers to print different types of text to a handle.
data Printers'
Printers :: !Color -> Printer -> !Printer -> !Printer -> !Printer -> !Printer -> !Color -> Doc -> Doc -> ![Printable] -> [Printable] -> Printers'
colorP :: Printers' -> !Color -> Printer
invisibleP :: Printers' -> !Printer
hiddenP :: Printers' -> !Printer
userchunkP :: Printers' -> !Printer
defP :: Printers' -> !Printer
lineColorT :: Printers' -> !Color -> Doc -> Doc
lineColorS :: Printers' -> ![Printable] -> [Printable]
type Printer = Printable -> St -> Document
data Color
Blue :: Color
Red :: Color
Green :: Color
Cyan :: Color
Magenta :: Color
-- | hputDoc puts a doc on the given handle using
-- simplePrinters
hPutDoc :: Handle -> Doc -> IO ()
hPutDocLn :: Handle -> Doc -> IO ()
-- | putDoc puts a doc on stdout using the simple printer
-- simplePrinters.
putDoc :: Doc -> IO ()
-- | putDocLn puts a doc, followed by a newline on stdout using
-- simplePrinters
putDocLn :: Doc -> IO ()
-- | hputDocWith puts a doc on the given handle using the given
-- printer.
hPutDocWith :: Printers -> Handle -> Doc -> IO ()
-- | hputDocLnWith puts a doc, followed by a newline on the given
-- handle using the given printer.
hPutDocLnWith :: Printers -> Handle -> Doc -> IO ()
-- | putDocWith puts a doc on stdout using the given printer.
putDocWith :: Printers -> Doc -> IO ()
-- | putDocLnWith puts a doc, followed by a newline on stdout using
-- the given printer.
putDocLnWith :: Printers -> Doc -> IO ()
-- | renders a Doc into a String with control codes for the
-- special features of the doc.
renderString :: Doc -> String
-- | renders a Doc into a String using a given set of
-- printers.
renderStringWith :: Printers' -> Doc -> String
-- | renders a Doc into ByteString with control codes for the
-- special features of the Doc. See also readerString.
renderPS :: Doc -> ByteString
-- | renders a doc into a ByteString using a given set of printers.
renderPSWith :: Printers' -> Doc -> ByteString
-- | renders a Doc into a list of PackedStrings, one for
-- each line.
renderPSs :: Doc -> [ByteString]
-- | renders a Doc into a list of PackedStrings, one for
-- each chunk of text that was added to the doc, using the given set of
-- printers.
renderPSsWith :: Printers' -> Doc -> [ByteString]
lineColor :: Color -> Doc -> Doc
prefix :: String -> Doc -> Doc
insertBeforeLastline :: Doc -> Doc -> Doc
-- | colorText creates a Doc containing colored text from a
-- String
colorText :: Color -> String -> Doc
-- | invisibleText creates a Doc containing invisible text
-- from a String
invisibleText :: String -> Doc
-- | hiddenText creates a Doc containing hidden text from a
-- String
hiddenText :: String -> Doc
hiddenPrefix :: String -> Doc -> Doc
-- | userchunk creates a Doc containing a user chunk from a
-- String
userchunk :: String -> Doc
-- | text creates a Doc from a String, using
-- printable.
text :: String -> Doc
printable :: Printable -> Doc
-- | wrapText n s is a Doc representing s
-- line-wrapped at n characters
wrapText :: Int -> String -> Doc
blueText :: String -> Doc
-- | blueText creates a Doc containing blue text from a
-- String
redText :: String -> Doc
greenText :: String -> Doc
magentaText :: String -> Doc
cyanText :: String -> Doc
-- | unsafeText creates a Doc from a String, using
-- simplePrinter directly
unsafeText :: String -> Doc
-- | unsafeBoth builds a Doc from a String and a
-- ByteString representing the same text, but does not check that
-- they do.
unsafeBoth :: String -> ByteString -> Doc
-- | unsafeBothText builds a Doc from a String. The
-- string is stored in the Doc as both a String and a ByteString.
unsafeBothText :: String -> Doc
-- | unsafeChar creates a Doc containing just one character.
unsafeChar :: Char -> Doc
-- | invisiblePS creates a Doc with invisible text from a
-- ByteString
invisiblePS :: ByteString -> Doc
-- | packedString builds a Doc from a ByteString using
-- printable
packedString :: ByteString -> Doc
-- | unsafePackedString builds a Doc from a ByteString
-- using simplePrinter
unsafePackedString :: ByteString -> Doc
-- | userchunkPS creates a Doc representing a user chunk from
-- a ByteString.
userchunkPS :: ByteString -> Doc
-- | simplePrinters is a Printers which uses the set
-- 'simplePriners\'' on any handle.
simplePrinters :: Printers
-- | invisiblePrinter is the Printer for hidden text. It just
-- replaces the document with empty. It's useful to have a printer
-- that doesn't actually do anything because this allows you to have
-- tunable policies, for example, only printing some text if it's to the
-- terminal, but not if it's to a file or vice-versa.
invisiblePrinter :: Printer
-- | simplePrinter is the simplest Printer: it just
-- concatenates together the pieces of the Doc
simplePrinter :: Printer
doc :: ([Printable] -> [Printable]) -> Doc
-- | The empty Doc.
empty :: Doc
-- | '()' is the concatenation operator for Docs
(<>) :: Doc -> Doc -> Doc
-- | a <?> b is a if it is not empty, else
-- b.
(>) :: Doc -> Doc -> Doc
-- | a <+> b is a followed by a space, then
-- b.
(<+>) :: Doc -> Doc -> Doc
-- | a $$ b is a above b.
($$) :: Doc -> Doc -> Doc
-- | vcat piles vertically a list of Docs.
vcat :: [Doc] -> Doc
-- | vsep piles vertically a list of Docs leaving a blank
-- line between each.
vsep :: [Doc] -> Doc
-- | hcat concatenates (horizontally) a list of Docs
hcat :: [Doc] -> Doc
minus :: Doc
-- | Minimal Docs representing the common characters space,
-- newline minus, plus, and backslash.
newline :: Doc
plus :: Doc
space :: Doc
backslash :: Doc
-- | lparen is the Doc that represents "("
lparen :: Doc
-- | rparen is the Doc that represents ")"
rparen :: Doc
-- | parens doc returns a Doc with the content of
-- doc put within a pair of parenthesis.
parens :: Doc -> Doc
errorDoc :: Doc -> a
module Darcs.Bug
_bug :: BugStuff -> String -> a
_bugDoc :: BugStuff -> Doc -> a
_impossible :: BugStuff -> a
_fromJust :: BugStuff -> Maybe a -> a
module Darcs.Witnesses.Ordered
data EqCheck
IsEq :: EqCheck
NotEq :: EqCheck
isEq :: EqCheck -> Bool
data (:>) a1 a2
(:>) :: (a1) -> (a2) -> :> a1 a2
data (:<) a1 a2
(:<) :: (a1) -> (a2) -> :< a1 a2
data (:\/:) a1 a2
(:\/:) :: (a1) -> (a2) -> :\/: a1 a2
data (:/\:) a1 a2
(:/\:) :: (a1) -> (a2) -> :/\: a1 a2
data (:||:) a1 a2
(:||:) :: (a1) -> (a2) -> :||: a1 a2
data FL a
(:>:) :: a -> FL a -> FL a
NilFL :: FL a
data RL a
(:<:) :: a -> RL a -> RL a
NilRL :: RL a
data Proof a
Proof :: a -> Proof a
lengthFL :: FL a -> Int
mapFL :: (a -> b) -> FL a -> [b]
mapFL_FL :: (a -> b) -> FL a -> FL b
spanFL :: (a -> Bool) -> FL a -> (FL a :> FL a)
foldlFL :: (a -> b -> a) -> a -> FL b -> a
allFL :: (a -> Bool) -> FL a -> Bool
anyFL :: (a -> Bool) -> FL a -> Bool
filterFL :: (a -> Bool) -> FL a -> [Sealed2 a]
splitAtFL :: Int -> FL a -> (FL a :> FL a)
splitAtRL :: Int -> RL a -> (RL a :< RL a)
bunchFL :: Int -> FL a -> FL (FL a)
foldlRL :: (a -> b -> a) -> a -> RL b -> a
lengthRL :: RL a -> Int
isShorterThanRL :: RL a -> Int -> Bool
mapRL :: (a -> b) -> RL a -> [b]
mapRL_RL :: (a -> b) -> RL a -> RL b
zipWithFL :: (a -> p -> q) -> [a] -> FL p -> FL q
unsafeMap_l2f :: (a -> b) -> [a] -> FL b
filterE :: (a -> EqCheck) -> [a] -> [Proof a]
filterFLFL :: (p -> EqCheck) -> FL p -> FL p
filterRL :: (p -> Bool) -> RL p -> [Sealed2 p]
reverseFL :: FL a -> RL a
reverseRL :: RL a -> FL a
(+>+) :: FL a -> FL a -> FL a
(+<+) :: RL a -> RL a -> RL a
nullFL :: FL a -> Bool
concatFL :: FL (FL a) -> FL a
concatRL :: RL (RL a) -> RL a
concatReverseFL :: FL (RL a) -> RL a
headRL :: RL a -> FlippedSeal a
class MyEq p
unsafeCompare :: (MyEq p) => p -> p -> Bool
(=\/=) :: (MyEq p) => p -> p -> EqCheck
(=/\=) :: (MyEq p) => p -> p -> EqCheck
consRLSealed :: a -> FlippedSeal (RL a) -> FlippedSeal (RL a)
nullRL :: RL a -> Bool
toFL :: [FreeLeft a] -> Sealed (FL a)
data (:>>) a1 a2
(:>>) :: (a1) -> (a2) -> :>> a1 a2
unsafeCoercePStart :: a -> a
unsafeCoercePEnd :: a -> a
unsafeCoerceP :: a -> a
unsafeCoerceP2 :: t -> t
spanFL_M :: (Monad m) => (a -> m Bool) -> FL a -> m ((FL a :> FL a))
instance (Show2 a) => Show2 (FL a)
instance (Show2 a) => Show (FL a)
instance (MyEq a) => Eq (Sealed a)
instance (Show2 a, Show2 b) => Show2 (a :\/: b)
instance (Show2 a, Show2 b) => Show (a :\/: b)
instance (Show2 a, Show2 b) => Show2 (a :> b)
instance (MyEq a, MyEq b) => MyEq (a :< b)
instance (MyEq a, MyEq b) => MyEq (a :> b)
instance (Show2 a, Show2 b) => Show (a :> b)
instance Show EqCheck
instance Eq EqCheck
module Darcs.Witnesses.WZipper
data FZipper a
FZipper :: RL a -> FL a -> FZipper a
focus :: FZipper a -> Maybe (Sealed2 a)
leftmost :: FZipper p -> Bool
left :: FZipper p -> FZipper p
rightmost :: FZipper p -> Bool
right :: FZipper p -> FZipper p
jokers :: FZipper a -> FlippedSeal (FL a)
clowns :: FZipper a -> Sealed ((RL a))
flToZipper :: FL a -> FZipper a
lengthFZ :: FZipper a -> Int
nullFZ :: FZipper a -> Bool
toEnd :: FZipper p -> FZipper p
-- | Path resolving:
--
--
-- - A URL contains the sequence "://".
-- - A local filepath does not contain colons, except as second
-- character (windows drives).
-- - A path that is neither a URL nor a local file is an ssh-path.
--
--
-- Examples:
--
--
-- /usr/repo/foo -- local file
-- c:/src/darcs -- local file
-- http://darcs.net/ -- URL
-- peter@host:/path -- ssh
-- droundy@host: -- ssh
-- host:/path -- ssh
--
--
-- This means that single-letter hosts in ssh-paths do not work, unless a
-- username is provided.
--
-- Perhaps ssh-paths should use "ssh://user@host/path"-syntax
-- instead?
module Darcs.URL
isFile :: String -> Bool
isUrl :: String -> Bool
isSsh :: String -> Bool
isRelative :: String -> Bool
isAbsolute :: String -> Bool
isSshNopath :: String -> Bool
-- | Various abstractions for dealing with paths.
module Darcs.RepoPath
data AbsolutePath
-- | Take an absolute path and a string representing a (possibly relative)
-- path and combine them into an absolute path. If the second argument is
-- already absolute, then the first argument gets ignored. This function
-- also takes care that the result is converted to Posix convention and
-- normalized. Also, parent directories ("..") at the front of the string
-- argument get canceled out against trailing directory parts of the
-- absolute path argument.
--
-- Regarding the last point, someone more familiar with how these
-- functions are used should verify that this is indeed necessary or at
-- least useful.
makeAbsolute :: AbsolutePath -> FilePath -> AbsolutePath
-- | Interpret a possibly relative path wrt the current working directory.
ioAbsolute :: FilePath -> IO AbsolutePath
-- | The root directory as an absolute path.
rootDirectory :: AbsolutePath
-- | This is for situations where a string (e.g. a command line argument)
-- may take the value "-" to mean stdin or stdout (which one depends on
-- context) instead of a normal file path.
data AbsolutePathOrStd
makeAbsoluteOrStd :: AbsolutePath -> String -> AbsolutePathOrStd
ioAbsoluteOrStd :: String -> IO AbsolutePathOrStd
-- | Execute either the first or the second argument action, depending on
-- whether the given path is an AbsolutePath or stdin/stdout.
useAbsoluteOrStd :: (AbsolutePath -> a) -> a -> AbsolutePathOrStd -> a
stdOut :: AbsolutePathOrStd
data AbsoluteOrRemotePath
ioAbsoluteOrRemote :: String -> IO AbsoluteOrRemotePath
isRemote :: AbsoluteOrRemotePath -> Bool
-- | Paths which are relative to the local darcs repository and normalized.
-- Note: These are understood not to have the dot in front.
data SubPath
-- | Make the second path relative to the first, if possible
makeSubPathOf :: AbsolutePath -> AbsolutePath -> Maybe SubPath
simpleSubPath :: FilePath -> Maybe SubPath
sp2fn :: SubPath -> FileName
class FilePathOrURL a
toPath :: (FilePathOrURL a) => a -> String
class (FilePathOrURL a) => FilePathLike a
toFilePath :: (FilePathLike a) => a -> FilePath
getCurrentDirectory :: IO AbsolutePath
setCurrentDirectory :: (FilePathLike p) => p -> IO ()
instance Eq AbsoluteOrRemotePath
instance Ord AbsoluteOrRemotePath
instance Eq AbsolutePathOrStd
instance Ord AbsolutePathOrStd
instance Eq AbsolutePath
instance Ord AbsolutePath
instance Eq SubPath
instance Ord SubPath
instance Show AbsoluteOrRemotePath
instance Show AbsolutePathOrStd
instance Show SubPath
instance Show AbsolutePath
instance (CharLike c) => FilePathLike [c]
instance CharLike Char
instance FilePathLike SubPath
instance FilePathLike AbsolutePath
instance FilePathLike FileName
instance FilePathOrURL FileName
instance FilePathOrURL AbsoluteOrRemotePath
instance (CharLike c) => FilePathOrURL [c]
instance FilePathOrURL SubPath
instance FilePathOrURL AbsolutePath
module Darcs.Utils
catchall :: IO a -> IO a -> IO a
-- | Given two shell commands as arguments, execute the former. The latter
-- is then executed if the former failed because the executable wasn't
-- found (code 127), wasn't executable (code 126) or some other exception
-- occurred. Other failures (such as the user holding ^C) do not cause
-- the second command to be tried.
ortryrunning :: IO ExitCode -> IO ExitCode -> IO ExitCode
nubsort :: (Ord a) => [a] -> [a]
breakCommand :: String -> (String, [String])
clarifyErrors :: IO a -> String -> IO a
prettyException :: SomeException -> String
prettyError :: IOError -> String
putStrLnError :: String -> IO ()
putDocLnError :: Doc -> IO ()
withCurrentDirectory :: (FilePathLike p) => p -> IO a -> IO a
withUMask :: String -> IO a -> IO a
-- | Ask the user for a line of input.
askUser :: String -> IO String
stripCr :: String -> String
showHexLen :: (Integral a) => Int -> a -> String
addToErrorLoc :: IOException -> String -> IOException
maybeGetEnv :: String -> IO (Maybe String)
-- | Returns Just l where l is first non-blank string in input array;
-- Nothing if no non-blank entries
firstNotBlank :: [String] -> Maybe String
-- | The firstJustM returns the first Just entry in a list of monadic
-- operations. This is close to `listToMaybe fmap sequence`, but
-- the sequence operator evaluates all monadic members of the list before
-- passing it along (i.e. sequence is strict). The firstJustM is lazy in
-- that list member monads are only evaluated up to the point where the
-- first Just entry is obtained.
firstJustM :: (Monad m) => [m (Maybe a)] -> m (Maybe a)
-- | The firstJustIO is a slight modification to firstJustM: the entries in
-- the list must be IO monad operations and the firstJustIO will silently
-- turn any monad call that throws an exception into Nothing, basically
-- causing it to be ignored.
firstJustIO :: [IO (Maybe a)] -> IO (Maybe a)
getViewer :: IO String
editFile :: (FilePathLike p) => p -> IO ExitCode
runEditor :: FilePath -> IO ExitCode
data PromptConfig
PromptConfig :: String -> [Char] -> [Char] -> Maybe Char -> [Char] -> PromptConfig
pPrompt :: PromptConfig -> String
pBasicCharacters :: PromptConfig -> [Char]
-- | only shown on help
pAdvancedCharacters :: PromptConfig -> [Char]
pDefault :: PromptConfig -> Maybe Char
pHelp :: PromptConfig -> [Char]
promptYorn :: [Char] -> IO Char
promptChar :: PromptConfig -> IO Char
environmentHelpEditor :: ([String], [String])
environmentHelpPager :: ([String], [String])
formatPath :: String -> String
isFileReallySymlink :: FilePath -> IO Bool
doesDirectoryReallyExist :: FilePath -> IO Bool
doesFileReallyExist :: FilePath -> IO Bool
-- | Same as filterPath, but for ordinary FilePaths (as
-- opposed to AnchoredPath).
filterFilePaths :: [FilePath] -> AnchoredPath -> t -> Bool
-- | Construct a filter from a list of AnchoredPaths, that will accept any
-- path that is either a parent or a child of any of the listed paths,
-- and discard everything else.
filterPaths :: [AnchoredPath] -> AnchoredPath -> t -> Bool
treeHas :: (MonadError e m, Functor m, Monad m) => Tree m -> FilePath -> m Bool
treeHasDir :: (MonadError e m, Functor m, Monad m) => Tree m -> FilePath -> m Bool
treeHasFile :: (MonadError e m, Functor m, Monad m) => Tree m -> FilePath -> m Bool
treeHasAnycase :: (MonadError e m, Functor m, Monad m) => Tree m -> FilePath -> m Bool
module Darcs.Compat
stdoutIsAPipe :: IO Bool
mkStdoutTemp :: String -> IO String
canonFilename :: FilePath -> IO FilePath
maybeRelink :: String -> String -> IO Bool
atomicCreate :: FilePath -> IO ()
sloppyAtomicCreate :: FilePath -> IO ()
module Darcs.Flags
-- | The DarcsFlag type is a list of all flags that can ever be
-- passed to darcs, or to one of its commands.
data DarcsFlag
Help :: DarcsFlag
ListOptions :: DarcsFlag
NoTest :: DarcsFlag
Test :: DarcsFlag
OnlyChangesToFiles :: DarcsFlag
ChangesToAllFiles :: DarcsFlag
LeaveTestDir :: DarcsFlag
NoLeaveTestDir :: DarcsFlag
Timings :: DarcsFlag
Debug :: DarcsFlag
DebugVerbose :: DarcsFlag
DebugHTTP :: DarcsFlag
Verbose :: DarcsFlag
NormalVerbosity :: DarcsFlag
Quiet :: DarcsFlag
Target :: String -> DarcsFlag
Cc :: String -> DarcsFlag
Output :: AbsolutePathOrStd -> DarcsFlag
OutputAutoName :: AbsolutePath -> DarcsFlag
Subject :: String -> DarcsFlag
InReplyTo :: String -> DarcsFlag
SendmailCmd :: String -> DarcsFlag
Author :: String -> DarcsFlag
PatchName :: String -> DarcsFlag
OnePatch :: String -> DarcsFlag
SeveralPatch :: String -> DarcsFlag
AfterPatch :: String -> DarcsFlag
UpToPatch :: String -> DarcsFlag
TagName :: String -> DarcsFlag
LastN :: Int -> DarcsFlag
MaxCount :: Int -> DarcsFlag
PatchIndexRange :: Int -> Int -> DarcsFlag
NumberPatches :: DarcsFlag
OneTag :: String -> DarcsFlag
AfterTag :: String -> DarcsFlag
UpToTag :: String -> DarcsFlag
Context :: AbsolutePath -> DarcsFlag
Count :: DarcsFlag
LogFile :: AbsolutePath -> DarcsFlag
RmLogFile :: DarcsFlag
DontRmLogFile :: DarcsFlag
DistName :: String -> DarcsFlag
All :: DarcsFlag
Recursive :: DarcsFlag
NoRecursive :: DarcsFlag
Reorder :: DarcsFlag
RestrictPaths :: DarcsFlag
DontRestrictPaths :: DarcsFlag
AskDeps :: DarcsFlag
NoAskDeps :: DarcsFlag
IgnoreTimes :: DarcsFlag
DontIgnoreTimes :: DarcsFlag
LookForAdds :: DarcsFlag
NoLookForAdds :: DarcsFlag
AnyOrder :: DarcsFlag
CreatorHash :: String -> DarcsFlag
Intersection :: DarcsFlag
Union :: DarcsFlag
Complement :: DarcsFlag
Sign :: DarcsFlag
SignAs :: String -> DarcsFlag
NoSign :: DarcsFlag
SignSSL :: String -> DarcsFlag
HappyForwarding :: DarcsFlag
NoHappyForwarding :: DarcsFlag
Verify :: AbsolutePath -> DarcsFlag
VerifySSL :: AbsolutePath -> DarcsFlag
SSHControlMaster :: DarcsFlag
NoSSHControlMaster :: DarcsFlag
RemoteDarcs :: String -> DarcsFlag
EditDescription :: DarcsFlag
NoEditDescription :: DarcsFlag
Toks :: String -> DarcsFlag
EditLongComment :: DarcsFlag
NoEditLongComment :: DarcsFlag
PromptLongComment :: DarcsFlag
KeepDate :: DarcsFlag
NoKeepDate :: DarcsFlag
AllowConflicts :: DarcsFlag
MarkConflicts :: DarcsFlag
NoAllowConflicts :: DarcsFlag
SkipConflicts :: DarcsFlag
Boring :: DarcsFlag
SkipBoring :: DarcsFlag
AllowCaseOnly :: DarcsFlag
DontAllowCaseOnly :: DarcsFlag
AllowWindowsReserved :: DarcsFlag
DontAllowWindowsReserved :: DarcsFlag
DontGrabDeps :: DarcsFlag
DontPromptForDependencies :: DarcsFlag
PromptForDependencies :: DarcsFlag
Compress :: DarcsFlag
NoCompress :: DarcsFlag
UnCompress :: DarcsFlag
WorkRepoDir :: String -> DarcsFlag
WorkRepoUrl :: String -> DarcsFlag
RemoteRepo :: String -> DarcsFlag
NewRepo :: String -> DarcsFlag
Reply :: String -> DarcsFlag
ApplyAs :: String -> DarcsFlag
MachineReadable :: DarcsFlag
HumanReadable :: DarcsFlag
Pipe :: DarcsFlag
Interactive :: DarcsFlag
DiffCmd :: String -> DarcsFlag
ExternalMerge :: String -> DarcsFlag
Summary :: DarcsFlag
NoSummary :: DarcsFlag
Unified :: DarcsFlag
NonUnified :: DarcsFlag
Reverse :: DarcsFlag
Forward :: DarcsFlag
Partial :: DarcsFlag
Complete :: DarcsFlag
Lazy :: DarcsFlag
Ephemeral :: DarcsFlag
FixFilePath :: AbsolutePath -> AbsolutePath -> DarcsFlag
DiffFlags :: String -> DarcsFlag
XMLOutput :: DarcsFlag
ForceReplace :: DarcsFlag
OnePattern :: PatchMatch -> DarcsFlag
SeveralPattern :: PatchMatch -> DarcsFlag
AfterPattern :: PatchMatch -> DarcsFlag
UpToPattern :: PatchMatch -> DarcsFlag
NonApply :: DarcsFlag
NonVerify :: DarcsFlag
NonForce :: DarcsFlag
DryRun :: DarcsFlag
SetDefault :: DarcsFlag
NoSetDefault :: DarcsFlag
FancyMoveAdd :: DarcsFlag
NoFancyMoveAdd :: DarcsFlag
Disable :: DarcsFlag
SetScriptsExecutable :: DarcsFlag
DontSetScriptsExecutable :: DarcsFlag
Bisect :: DarcsFlag
UseHashedInventory :: DarcsFlag
UseOldFashionedInventory :: DarcsFlag
UseFormat2 :: DarcsFlag
PristinePlain :: DarcsFlag
PristineNone :: DarcsFlag
NoUpdateWorking :: DarcsFlag
Sibling :: AbsolutePath -> DarcsFlag
Relink :: DarcsFlag
RelinkPristine :: DarcsFlag
NoLinks :: DarcsFlag
OptimizePristine :: DarcsFlag
OptimizeHTTP :: DarcsFlag
UpgradeFormat :: DarcsFlag
Files :: DarcsFlag
NoFiles :: DarcsFlag
Directories :: DarcsFlag
NoDirectories :: DarcsFlag
Pending :: DarcsFlag
NoPending :: DarcsFlag
PosthookCmd :: String -> DarcsFlag
NoPosthook :: DarcsFlag
AskPosthook :: DarcsFlag
RunPosthook :: DarcsFlag
PrehookCmd :: String -> DarcsFlag
NoPrehook :: DarcsFlag
AskPrehook :: DarcsFlag
RunPrehook :: DarcsFlag
UMask :: String -> DarcsFlag
StoreInMemory :: DarcsFlag
ApplyOnDisk :: DarcsFlag
NoHTTPPipelining :: DarcsFlag
NoCache :: DarcsFlag
AllowUnrelatedRepos :: DarcsFlag
Check :: DarcsFlag
Repair :: DarcsFlag
JustThisRepo :: DarcsFlag
NullFlag :: DarcsFlag
data Compression
NoCompression :: Compression
GzipCompression :: Compression
compression :: [DarcsFlag] -> Compression
wantExternalMerge :: [DarcsFlag] -> Maybe String
isInteractive :: [DarcsFlag] -> Bool
maxCount :: [DarcsFlag] -> Maybe Int
willIgnoreTimes :: [DarcsFlag] -> Bool
willRemoveLogFile :: [DarcsFlag] -> Bool
isUnified :: [DarcsFlag] -> Bool
willStoreInMemory :: [DarcsFlag] -> Bool
doHappyForwarding :: [DarcsFlag] -> Bool
includeBoring :: [DarcsFlag] -> Bool
doAllowCaseOnly :: [DarcsFlag] -> Bool
doAllowWindowsReserved :: [DarcsFlag] -> Bool
doReverse :: [DarcsFlag] -> Bool
showChangesOnlyToFiles :: [DarcsFlag] -> Bool
-- | Set flags to a default value, but only one has not already been
-- provided
defaultFlag :: [DarcsFlag] -> DarcsFlag -> [DarcsFlag] -> [DarcsFlag]
instance Eq DarcsFlag
instance Show DarcsFlag
module Darcs.Lock
withLock :: String -> IO a -> IO a
-- | Tries to perform some task if it can obtain the lock, Otherwise, just
-- gives up without doing the task
withLockCanFail :: String -> IO a -> IO (Either () a)
-- | withTemp safely creates an empty file (not open for writing)
-- and returns its name.
--
-- The temp file operations are rather similar to the locking operations,
-- in that they both should always try to clean up, so exitWith causes
-- trouble.
withTemp :: (String -> IO a) -> IO a
-- | withOpenTemp creates an already open temporary file. Both of
-- them run their argument and then delete the file. Also, both of them
-- (to my knowledge) are not susceptible to race conditions on the
-- temporary file (as long as you never delete the temporary file; that
-- would reintroduce a race condition).
withOpenTemp :: ((Handle, String) -> IO a) -> IO a
withStdoutTemp :: (String -> IO a) -> IO a
-- | withTempDir creates an empty directory and then removes it when
-- it is no longer needed. withTempDir creates a temporary directory. The
-- location of that directory is determined by the contents of
-- _darcsprefstmpdir, if it exists, otherwise by
-- $DARCS_TMPDIR, and if that doesn't exist then whatever your
-- operating system considers to be a a temporary directory (e.g.
-- $TMPDIR under Unix, $TEMP under Windows).
--
-- If none of those exist it creates the temporary directory in the
-- current directory, unless the current directory is under a _darcs
-- directory, in which case the temporary directory in the parent of the
-- highest _darcs directory to avoid accidentally corrupting darcs's
-- internals. This should not fail, but if it does indeed fail, we go
-- ahead and use the current directory anyway. If
-- $DARCS_KEEP_TMPDIR variable is set temporary directory is not
-- removed, this can be useful for debugging.
withTempDir :: String -> (AbsolutePath -> IO a) -> IO a
-- | withPermDir is like withTempDir, except that it doesn't
-- delete the directory afterwards.
withPermDir :: String -> (AbsolutePath -> IO a) -> IO a
withDelayedDir :: String -> (AbsolutePath -> IO a) -> IO a
withNamedTemp :: String -> (String -> IO a) -> IO a
writeToFile :: (FilePathLike p) => p -> (Handle -> IO ()) -> IO ()
appendToFile :: (FilePathLike p) => p -> (Handle -> IO ()) -> IO ()
writeBinFile :: (FilePathLike p) => p -> String -> IO ()
-- | Writes a file. Differs from writeBinFile in that it writes the string
-- encoded with the current locale instead of what GHC thinks is right.
writeLocaleFile :: (FilePathLike p) => p -> String -> IO ()
writeDocBinFile :: (FilePathLike p) => p -> Doc -> IO ()
appendBinFile :: (FilePathLike p) => p -> String -> IO ()
appendDocBinFile :: (FilePathLike p) => p -> Doc -> IO ()
readBinFile :: (FilePathLike p) => p -> IO String
-- | Reads a file. Differs from readBinFile in that it interprets the file
-- in the current locale instead of as ISO-8859-1.
readLocaleFile :: (FilePathLike p) => p -> IO String
readDocBinFile :: (FilePathLike p) => p -> IO Doc
writeAtomicFilePS :: (FilePathLike p) => p -> ByteString -> IO ()
gzWriteAtomicFilePS :: (FilePathLike p) => p -> ByteString -> IO ()
gzWriteAtomicFilePSs :: (FilePathLike p) => p -> [ByteString] -> IO ()
gzWriteDocFile :: (FilePathLike p) => p -> Doc -> IO ()
rmRecursive :: FilePath -> IO ()
removeFileMayNotExist :: (FilePathLike p) => p -> IO ()
canonFilename :: FilePath -> IO FilePath
maybeRelink :: String -> String -> IO Bool
worldReadableTemp :: String -> IO String
tempdirLoc :: IO FilePath
editText :: String -> ByteString -> IO ByteString
environmentHelpTmpdir :: ([String], [String])
environmentHelpKeepTmpdir :: ([String], [String])
module Ssh
grabSSH :: String -> Connection -> IO ByteString
runSSH :: SSHCmd -> String -> [String] -> [String] -> Redirects -> IO ExitCode
-- | Return the command and arguments needed to run an ssh command along
-- with any extra features like use of the control master. See
-- getSSHOnly
getSSH :: SSHCmd -> String -> IO (String, [String])
copySSH :: String -> String -> FilePath -> IO ()
copySSHs :: String -> String -> [String] -> FilePath -> IO ()
data SSHCmd
SSH :: SSHCmd
SCP :: SSHCmd
SFTP :: SSHCmd
environmentHelpSsh :: ([String], [String])
environmentHelpScp :: ([String], [String])
environmentHelpSshPort :: ([String], [String])
instance Show SSHCmd
-- | LCS stands for Longest Common Subsequence, and it is a relatively
-- challenging problem to find an LCS efficiently. This module implements
-- the algorithm described in:
--
-- An O(ND) Difference Algorithm and its Variations, Eugene Myers,
-- Algorithmica Vol. 1 No. 2, 1986, pp. 251-266; especially the variation
-- described in section 4.2 and most refinements implemented in GNU diff
-- (D is the edit-distance).
--
-- There is currently no heuristic to reduce the running time and produce
-- suboptimal output for large inputs with many differences. It behaves
-- like GNU diff with the -d option in this regard.
--
-- In the first step, a hash value for every line is calculated and
-- collisions are marked with a special value. This reduces a string
-- comparison to an int comparison for line tuples where at least one of
-- the hash values is not equal to the special value. After that, lines
-- which only exists in one of the files are removed and marked as
-- changed which reduces the running time of the following difference
-- algorithm. GNU diff additionally removes lines that appear very often
-- in the other file in some cases. The last step tries to create longer
-- changed regions and line up deletions in the first file to insertions
-- in the second by shifting changed lines forward and backward.
module Lcs
-- | create a list of changes between a and b, each change has the form
-- (starta, lima, startb, limb) which means that a[starta, lima) has to
-- be replaced by b[startb, limb)
getChanges :: [ByteString] -> [ByteString] -> [(Int, [ByteString], [ByteString])]
aLen :: (IArray a e) => a Int e -> Int
type BArray = UArray Int Bool
type PArray = Array Int ByteString
type BSTArray s = STUArray s Int Bool
-- | try to create nicer diffs by shifting around regions of changed lines
shiftBoundaries :: BSTArray s -> BSTArray s -> PArray -> Int -> Int -> ST s ()
module Darcs.Email
makeEmail :: String -> [(String, String)] -> (Maybe Doc) -> Doc -> (Maybe String) -> Doc
readEmail :: ByteString -> ByteString
-- | Formats an e-mail header by encoding any non-ascii characters using
-- UTF-8 and Q-encoding, and folding lines at appropriate points. It
-- doesn't do more than that, so the header name and header value should
-- be well-formatted give or take line length and encoding. So no
-- non-ASCII characters within quoted-string, quoted-pair, or atom; no
-- semantically meaningful signs in names; no non-ASCII characters in the
-- header name; etcetera.
formatHeader :: String -> String -> ByteString
module Crypt.SHA256
sha256sum :: ByteString -> String
-- | A parser for commandlines, returns an arg list and expands format
-- strings given in a translation table. Additionally the commandline can
-- end with %< specifying that the command expects input on
-- stdin.
--
-- Some tests for the parser.
--
--
-- formatTable = [('s',"<insert subject here>"),
-- ('a',"<insert author here>")]
--
-- testParser :: (Show a, Eq a) => Parser a -> String -> a -> a
-- testParser p s ok = case parse p "" s of
-- Left e -> error $ "Parser failed with: " ++ (show e)
-- Right res -> if res == ok
-- then res
-- else error $ "Parser failed: got "
-- ++ (show res) ++ ", expected "
-- ++ (show ok)
--
-- testCases = [("a b",(["a","b"], False)),
-- ("a b %<",(["a","b"], True)),
-- ("a b %< ",(["a","b"], True)),
-- ("\"arg0 contains spaces \\\"quotes\\\"\" b",
-- (["arg0 contains spaces \"quotes\"","b"],False)),
-- ("a %s %<",(["a","<insert subject here>"], True))]
--
-- runTests = map (uncurry $ testParser (commandline formatTable)) testCases
--
module CommandLine
-- | parse a commandline returning a list of strings (intended to be used
-- as argv) and a bool value which specifies if the command expects input
-- on stdin format specifiers with a mapping in ftable are accepted and
-- replaced by the given strings. E.g. if the ftable is
-- [(s,Some subject)], then %s is replaced by
-- Some subject
parseCmd :: FTable -> String -> Either ParseError ([String], Bool)
-- | for every mapping (c,s), add a mapping with uppercase c and the
-- urlencoded string s
addUrlencoded :: FTable -> FTable
module URL
copyUrl :: String -> FilePath -> Cachable -> IO ()
copyUrlFirst :: String -> FilePath -> Cachable -> IO ()
setDebugHTTP :: IO ()
disableHTTPPipelining :: IO ()
maxPipelineLength :: IO Int
waitUrl :: String -> IO ()
data Cachable
Cachable :: Cachable
Uncachable :: Cachable
MaxAge :: !CInt -> Cachable
environmentHelpProxy :: ([String], [String])
environmentHelpProxyPassword :: ([String], [String])
instance Eq Priority
instance Show Cachable
instance Eq Cachable
module Darcs.External
backupByRenaming :: FilePath -> IO ()
backupByCopying :: FilePath -> IO ()
copyFileOrUrl :: [DarcsFlag] -> FilePath -> FilePath -> Cachable -> IO ()
speculateFileOrUrl :: String -> FilePath -> IO ()
copyFilesOrUrls :: [DarcsFlag] -> FilePath -> [String] -> FilePath -> Cachable -> IO ()
copyLocal :: [DarcsFlag] -> String -> FilePath -> IO ()
cloneFile :: FilePath -> FilePath -> IO ()
cloneTree :: FilePath -> FilePath -> IO ()
cloneTreeExcept :: [FilePath] -> FilePath -> FilePath -> IO ()
clonePartialsTree :: FilePath -> FilePath -> [FilePath] -> IO ()
clonePaths :: FilePath -> FilePath -> [FilePath] -> IO ()
-- | fetchFile fileOrUrl cache returns the content of its argument
-- (either a file or an URL). If it has to download an url, then it will
-- use a cache as required by its second argument.
fetchFilePS :: String -> Cachable -> IO ByteString
-- | fetchFileLazyPS fileOrUrl cache lazily reads the content of
-- its argument (either a file or an URL). Warning: this function may
-- constitute a fd leak; make sure to force consumption of file contents
-- to avoid that.
fetchFileLazyPS :: String -> Cachable -> IO ByteString
gzFetchFilePS :: String -> Cachable -> IO ByteString
sendEmail :: String -> String -> String -> String -> String -> String -> IO ()
generateEmail :: Handle -> String -> String -> String -> String -> Doc -> IO ()
-- | Send an email, optionally containing a patch bundle (more precisely,
-- its description and the bundle itself)
sendEmailDoc :: String -> String -> String -> String -> String -> Maybe (Doc, Doc) -> Doc -> IO ()
resendEmail :: String -> String -> ByteString -> IO ()
signString :: [DarcsFlag] -> Doc -> IO Doc
verifyPS :: [DarcsFlag] -> ByteString -> IO (Maybe ByteString)
execDocPipe :: String -> [String] -> Doc -> IO Doc
execPipeIgnoreError :: String -> [String] -> Doc -> IO Doc
getTermNColors :: IO Int
pipeDoc :: String -> [String] -> Doc -> IO ExitCode
pipeDocSSH :: String -> [String] -> Doc -> IO ExitCode
-- | Run a command on a remote location without passing it any input or
-- reading its output. Return its ExitCode
execSSH :: String -> String -> IO ExitCode
remoteDarcsCmd :: [DarcsFlag] -> String
maybeURLCmd :: String -> String -> IO (Maybe (String))
data Cachable
Cachable :: Cachable
Uncachable :: Cachable
MaxAge :: !CInt -> Cachable
viewDoc :: Doc -> IO ()
viewDocWith :: Printers -> Doc -> IO ()
sendmailPath :: IO String
diffProgram :: IO String
-- | Get the name of the darcs executable (as supplied by
-- getProgName)
darcsProgram :: IO String
module Darcs.ColorPrinter
errorDoc :: Doc -> a
traceDoc :: Doc -> a -> a
assertDoc :: Maybe Doc -> a -> a
-- | fancyPrinters h returns a set of printers suitable for
-- outputting to h
fancyPrinters :: Printers
instance Show Doc
module Darcs.Repository.Format
-- | RepoFormat is the representation of the format of a
-- repository. Each sublist corresponds to a line in the format file.
-- Each line is decomposed into words.
newtype RepoFormat
RF :: [[ByteString]] -> RepoFormat
data RepoProperty
Darcs1_0 :: RepoProperty
Darcs2 :: RepoProperty
HashedInventory :: RepoProperty
-- | identifyRepoFormat URL identifies the format of the
-- repository at the given address. Return Left reason if it
-- fails, where reason explains why we weren't able to identify
-- the format.
identifyRepoFormat :: String -> IO (Either String RepoFormat)
createRepoFormat :: [DarcsFlag] -> RepoFormat
-- | writeRepoFormat writes the repo format to the given file.
writeRepoFormat :: RepoFormat -> FilePath -> IO ()
-- | writeProblem from tells if we can write to a repo in format
-- form. it returns Nothing if there's no problem
-- writing to such a repository.
writeProblem :: RepoFormat -> Maybe String
-- | readProblem from tells if we can write to a repo in format
-- form. it returns Nothing if there's no problem
-- reading from such a repository.
readProblem :: RepoFormat -> Maybe String
-- | writeProblem from tells if we can read and write to a repo in
-- format form. it returns Nothing if there's no
-- problem reading and writing to such a repository.
readfromAndWritetoProblem :: RepoFormat -> RepoFormat -> Maybe String
formatHas :: RepoProperty -> RepoFormat -> Bool
formatHasTogether :: [RepoProperty] -> RepoFormat -> Bool
instance Show RepoFormat
module Darcs.Repository.Motd
-- | Fetch and return the message of the day for a given repository.
getMotd :: String -> IO ByteString
-- | Display the message of the day for a given repository, unless either
-- the XMLOutput or the Quiet flags are passed in
showMotd :: [DarcsFlag] -> String -> IO ()
-- | This module is used by the push and put commands to apply the a bundle
-- to a remote repository. By remote I do not necessarily mean a
-- repository on another machine, it is just not the repository we're
-- located in.
module Darcs.RemoteApply
remoteApply :: [DarcsFlag] -> String -> Doc -> IO ExitCode
applyAs :: [DarcsFlag] -> Maybe String
module Darcs.IO
class (Functor m, MonadPlus m) => ReadableDirectory m
mDoesDirectoryExist :: (ReadableDirectory m) => FileName -> m Bool
mDoesFileExist :: (ReadableDirectory m) => FileName -> m Bool
mInCurrentDirectory :: (ReadableDirectory m) => FileName -> m a -> m a
mGetDirectoryContents :: (ReadableDirectory m) => m [FileName]
mReadBinFile :: (ReadableDirectory m) => FileName -> m String
mReadFilePS :: (ReadableDirectory m) => FileName -> m ByteString
mReadFilePSs :: (ReadableDirectory m) => FileName -> m [ByteString]
class (ReadableDirectory m) => WriteableDirectory m
mWithCurrentDirectory :: (WriteableDirectory m) => FileName -> m a -> m a
mSetFileExecutable :: (WriteableDirectory m) => FileName -> Bool -> m ()
mWriteBinFile :: (WriteableDirectory m) => FileName -> String -> m ()
mWriteFilePS :: (WriteableDirectory m) => FileName -> ByteString -> m ()
mWriteFilePSs :: (WriteableDirectory m) => FileName -> [ByteString] -> m ()
mCreateDirectory :: (WriteableDirectory m) => FileName -> m ()
mRemoveDirectory :: (WriteableDirectory m) => FileName -> m ()
mWriteDoc :: (WriteableDirectory m) => FileName -> Doc -> m ()
mCreateFile :: (WriteableDirectory m) => FileName -> m ()
mRemoveFile :: (WriteableDirectory m) => FileName -> m ()
mRename :: (WriteableDirectory m) => FileName -> FileName -> m ()
mModifyFilePS :: (WriteableDirectory m) => FileName -> (ByteString -> m ByteString) -> m ()
mModifyFilePSs :: (WriteableDirectory m) => FileName -> ([ByteString] -> m [ByteString]) -> m ()
data TolerantIO a
runTolerantly :: TolerantIO a -> IO a
runSilently :: SilentIO a -> IO a
instance (Functor m, MonadPlus m, MonadError e m) => WriteableDirectory (TreeMonad m)
instance (Functor m, MonadPlus m, MonadError e m) => ReadableDirectory (TreeMonad m)
instance WriteableDirectory SilentIO
instance WriteableDirectory TolerantIO
instance ReadableDirectory SilentIO
instance ReadableDirectory TolerantIO
instance MonadPlus SilentIO
instance MonadPlus TolerantIO
instance Monad SilentIO
instance Functor SilentIO
instance Monad TolerantIO
instance Functor TolerantIO
instance TolerantMonad SilentIO
instance TolerantMonad TolerantIO
instance WriteableDirectory IO
instance ReadableDirectory IO
module Darcs.Patch.Patchy
class (Apply p, Commute p, ShowPatch p, ReadPatch p, Invert p) => Patchy p
class Apply p
apply :: (Apply p, WriteableDirectory m) => [DarcsFlag] -> p -> m ()
applyAndTryToFix :: (Apply p, WriteableDirectory m) => p -> m (Maybe (String, p))
applyAndTryToFixFL :: (Apply p, WriteableDirectory m) => p -> m (Maybe (String, FL p))
mapMaybeSnd :: (a -> b) -> Maybe (c, a) -> Maybe (c, b)
-- | Things that can commute.
class Commute p
commute :: (Commute p) => (p :> p) -> Maybe ((p :> p))
merge :: (Commute p) => (p :\/: p) -> (p :/\: p)
listTouchedFiles :: (Commute p) => p -> [FilePath]
hunkMatches :: (Commute p) => (ByteString -> Bool) -> p -> Bool
commuteFLorComplain :: (Commute p) => (p :> FL p) -> Either (Sealed2 p) ((FL p :> p))
commuteRL :: (Commute p) => (RL p :> p) -> Maybe ((p :> RL p))
commuteFL :: (Commute p) => (p :> FL p) -> Maybe ((FL p :> p))
commuteRLFL :: (Commute p) => (RL p :> FL p) -> Maybe ((FL p :> RL p))
mergeFL :: (Commute p) => (p :\/: FL p) -> (FL p :/\: p)
-- | Swaps the ordered pair type so that commute can be called directly.
toFwdCommute :: (Commute p, Commute q, Monad m) => ((p :< q) -> m ((q :< p))) -> (q :> p) -> m ((p :> q))
-- | Swaps the ordered pair type from the order expected by commute to the
-- reverse order.
toRevCommute :: (Commute p, Commute q, Monad m) => ((p :> q) -> m ((q :> p))) -> (q :< p) -> m ((p :< q))
class (Commute p) => ShowPatch p
showPatch :: (ShowPatch p) => p -> Doc
showNicely :: (ShowPatch p) => p -> Doc
showContextPatch :: (ShowPatch p) => p -> TreeIO Doc
description :: (ShowPatch p) => p -> Doc
summary :: (ShowPatch p) => p -> Doc
writePatch :: (ShowPatch p) => FilePath -> p -> IO ()
gzWritePatch :: (ShowPatch p) => FilePath -> p -> IO ()
thing :: (ShowPatch p) => p -> String
things :: (ShowPatch p) => p -> String
class ReadPatch p
readPatch' :: (ReadPatch p, ParserM m) => Bool -> m (Maybe (Sealed (p)))
bracketedFL :: (ReadPatch p, ParserM m) => (m (Maybe (Sealed (p)))) -> Word8 -> Word8 -> m (Maybe (Sealed (FL p)))
peekfor :: (ParserM m) => String -> m a -> m a -> m a
class (MyEq p) => Invert p
invert :: (Invert p) => p -> p
identity :: (Invert p) => p
sloppyIdentity :: (Invert p) => p -> EqCheck
invertFL :: (Invert p) => FL p -> RL p
invertRL :: (Invert p) => RL p -> FL p
instance (ReadPatch p) => ReadPatch (RL p)
instance (Commute p) => Commute (RL p)
instance (Apply p) => Apply (RL p)
instance (ReadPatch p) => ReadPatch (FL p)
instance (Commute p) => Commute (FL p)
instance (Apply p) => Apply (FL p)
module Darcs.Patch.Permutations
-- | removeFL x xs removes x from xs if
-- x can be commuted to its head. Otherwise it returns
-- Nothing
removeFL :: (MyEq p, Commute p) => p -> FL p -> Maybe (FL p)
-- | removeRL is like removeFL except with RL
removeRL :: (MyEq p, Commute p) => p -> RL p -> Maybe (RL p)
removeCommon :: (MyEq p, Commute p) => (FL p :\/: FL p) -> (FL p :\/: FL p)
commuteWhatWeCanFL :: (Commute p) => (p :> FL p) -> (FL p :> (p :> FL p))
commuteWhatWeCanRL :: (Commute p) => (RL p :> p) -> (RL p :> (p :> RL p))
genCommuteWhatWeCanRL :: (((p :> p) -> Maybe ((p :> p)))) -> (RL p :> p) -> (RL p :> (p :> RL p))
-- | split an FL into left and right lists according
-- to a predicate, using commutation as necessary. If a patch does
-- satisfy the predicate but cannot be commuted past one that does not
-- satisfy the predicate, it goes in the right list.
partitionFL :: (Commute p) => (p -> Bool) -> FL p -> ((FL p :> (FL p :> FL p)))
-- | split an RL into left and right lists according
-- to a predicate, using commutation as necessary. If a patch does
-- satisfy the predicate but cannot be commuted past one that does not
-- satisfy the predicate, it goes in the left list.
partitionRL :: (Commute p) => (p -> Bool) -> RL p -> (RL p :> RL p)
-- | This is a minor variant of headPermutationsFL with each
-- permutation is simply returned as a FL
simpleHeadPermutationsFL :: (Commute p) => FL p -> [FL p]
-- | headPermutationsRL is like headPermutationsFL, except
-- that we operate on an RL (in other words, we are pushing things
-- to the end of a patch sequence instead of to the beginning).
headPermutationsRL :: (Commute p) => RL p -> [RL p]
-- | headPermutationsFL p:>:ps returns all the
-- permutations of the list in which one element of ps is
-- commuted past p
--
-- Suppose we have a sequence of patches
--
--
-- X h a y s-t-c k
--
--
-- Suppose furthermore that the patch c depends on t,
-- which in turn depends on s. This function will return
--
--
-- X :> h a y s t c k
-- h :> X a y s t c k
-- a :> X h y s t c k
-- y :> X h a s t c k
-- s :> X h a y t c k
-- k :> X h a y s t c
--
headPermutationsFL :: (Commute p) => FL p -> [(p :> FL p)]
-- | removeSubsequenceFL ab abc returns Just c'
-- where all the patches in ab have been commuted out of it, if
-- possible. If this is not possible for any reason (the set of patches
-- ab is not actually a subset of abc, or they can't be
-- commuted out) we return Nothing.
removeSubsequenceFL :: (MyEq p, Commute p) => FL p -> FL p -> Maybe (FL p)
-- | removeSubsequenceRL is like removeSubsequenceFL except
-- that it works on RL
removeSubsequenceRL :: (MyEq p, Commute p) => RL p -> RL p -> Maybe (RL p)
-- | Partition a list into the patches that commute with the given patch
-- and those that don't (including dependencies)
partitionConflictingFL :: (Commute p1, Invert p1) => CommuteFn p1 p2 -> FL p1 -> p2 -> (FL p1 :> FL p1)
-- | CommuteFn is the basis of a general framework for building up
-- commutation operations between different patch types in a generic
-- manner. Unfortunately type classes are not well suited to the problem
-- because of the multiple possible routes by which the commuter for (FL
-- p1, FL p2) can be built out of the commuter for (p1, p2) - and more
-- complicated problems when we start building multiple constructors on
-- top of each other. The type class resolution machinery really can't
-- cope with selecting some route, because it doesn't know that all
-- possible routes should be equivalent.
type CommuteFn p1 p2 = (p1 :> p2) -> Maybe ((p2 :> p1))
-- | Build a commuter between a patch and itself using the operation from
-- the type class.
selfCommuter :: (Commute p) => CommuteFn p p
commuterIdRL :: CommuteFn p1 p2 -> CommuteFn p1 (RL p2)
instance (Commute p, Invert p) => Invert (RL p)
instance (MyEq p, Commute p) => MyEq (RL p)
instance (Invert p, Commute p) => Invert (FL p)
instance (MyEq p, Commute p) => MyEq (FL p)
module Darcs.Patch.Prim
data Prim
Move :: !FileName -> !FileName -> Prim
DP :: !FileName -> !DirPatchType -> Prim
FP :: !FileName -> !FilePatchType -> Prim
Split :: FL Prim -> Prim
Identity :: Prim
ChangePref :: !String -> !String -> !String -> Prim
data IsConflictedPrim
IsC :: !ConflictState -> !Prim -> IsConflictedPrim
data ConflictState
Okay :: ConflictState
Conflicted :: ConflictState
Duplicated :: ConflictState
showPrim :: FileNameFormat -> Prim -> Doc
showPrimFL :: FileNameFormat -> FL Prim -> Doc
showHunk :: FileNameFormat -> FileName -> Int -> [ByteString] -> [ByteString] -> Doc
data DirPatchType
RmDir :: DirPatchType
AddDir :: DirPatchType
data FilePatchType
RmFile :: FilePatchType
AddFile :: FilePatchType
Hunk :: !Int -> [ByteString] -> [ByteString] -> FilePatchType
TokReplace :: !String -> !String -> !String -> FilePatchType
Binary :: ByteString -> ByteString -> FilePatchType
type CommuteFunction = (Prim :< Prim) -> Perhaps ((Prim :< Prim))
data Perhaps a
Unknown :: Perhaps a
Failed :: Perhaps a
Succeeded :: a -> Perhaps a
null_patch :: Prim
nullP :: Prim -> EqCheck
isNullPatch :: Prim -> Bool
isIdentity :: Prim -> EqCheck
formatFileName :: FileNameFormat -> FileName -> Doc
data FileNameFormat
OldFormat :: FileNameFormat
NewFormat :: FileNameFormat
adddir :: FilePath -> Prim
addfile :: FilePath -> Prim
binary :: FilePath -> ByteString -> ByteString -> Prim
changepref :: String -> String -> String -> Prim
hunk :: FilePath -> Int -> [ByteString] -> [ByteString] -> Prim
move :: FilePath -> FilePath -> Prim
rmdir :: FilePath -> Prim
rmfile :: FilePath -> Prim
tokreplace :: FilePath -> String -> String -> String -> Prim
primIsAddfile :: Prim -> Bool
primIsHunk :: Prim -> Bool
primIsBinary :: Prim -> Bool
primIsSetpref :: Prim -> Bool
-- | Tells you if two patches are in the same category, human-wise.
-- Currently just returns true if they are filepatches on the same file.
isSimilar :: Prim -> Prim -> Bool
primIsAdddir :: Prim -> Bool
is_filepatch :: Prim -> Maybe FileName
canonize :: Prim -> FL Prim
tryToShrink :: FL Prim -> FL Prim
modernizePrim :: Prim -> FL Prim
subcommutes :: [(String, (Prim :< Prim) -> Perhaps ((Prim :< Prim)))]
-- | sortCoalesceFL ps coalesces as many patches in
-- ps as possible, sorting the results according to the scheme
-- defined in comparePrim
sortCoalesceFL :: FL Prim -> FL Prim
join :: (Prim :> Prim) -> Maybe (Prim)
-- | canonizeFL ps puts a sequence of primitive patches
-- into canonical form. Even if the patches are just hunk patches, this
-- is not necessarily the same set of results as you would get if you
-- applied the sequence to a specific tree and recalculated a diff.
--
-- Note that this process does not preserve the commutation behaviour of
-- the patches and is therefore not appropriate for use when working with
-- already recorded patches (unless doing amend-record or the like).
canonizeFL :: FL Prim -> FL Prim
tryTokInternal :: String -> ByteString -> ByteString -> ByteString -> Maybe [ByteString]
tryShrinkingInverse :: FL Prim -> Maybe (FL Prim)
nFn :: FilePath -> FilePath
class FromPrim p
fromPrim :: (FromPrim p) => Prim -> p
class FromPrims p
fromPrims :: (FromPrims p) => FL Prim -> p
joinPatches :: (FromPrims p) => FL p -> p
class (FromPrim p) => ToFromPrim p
toPrim :: (ToFromPrim p) => p -> Maybe (Prim)
class (Invert p, Commute p, Effect p) => Conflict p
listConflictedFiles :: (Conflict p) => p -> [FilePath]
resolveConflicts :: (Conflict p) => p -> [[Sealed (FL Prim)]]
commuteNoConflicts :: (Conflict p) => (p :> p) -> Maybe ((p :> p))
conflictedEffect :: (Conflict p) => p -> [IsConflictedPrim]
isInconsistent :: (Conflict p) => p -> Maybe Doc
-- | Patches whose concrete effect which can be expressed as a list of
-- primitive patches.
--
-- A minimal definition would be either of effect or
-- effectRL.
class Effect p
effect :: (Effect p) => p -> FL Prim
effectRL :: (Effect p) => p -> RL Prim
isHunk :: (Effect p) => p -> Maybe (Prim)
commuteNoConflictsFL :: (Conflict p) => (p :> FL p) -> Maybe ((FL p :> p))
commuteNoConflictsRL :: (Conflict p) => (RL p :> p) -> Maybe ((p :> RL p))
instance Eq ConflictState
instance Ord ConflictState
instance Show ConflictState
instance Read ConflictState
instance Show Simple
instance Eq DirPatchType
instance Ord DirPatchType
instance Eq FilePatchType
instance Ord FilePatchType
instance (Effect p) => Effect (RL p)
instance (Effect p) => Effect (FL p)
instance Conflict Prim
instance Effect Prim
instance (Conflict p) => Conflict (RL p)
instance (Conflict p) => Conflict (FL p)
instance (FromPrim p) => FromPrims (RL p)
instance (FromPrim p) => FromPrims (FL p)
instance ToFromPrim Prim
instance FromPrim Prim
instance MyEq Prim
instance Commute Prim
instance MonadPlus Perhaps
instance Monad Perhaps
instance Show DirPatchType
instance Show FilePatchType
instance Show2 Prim
instance Show Prim
instance Invert Prim
instance MyEq DirPatchType
instance MyEq FilePatchType
module Darcs.FilePathMonad
data FilePathMonad a
withFilePaths :: [FilePath] -> FilePathMonad a -> [FilePath]
instance WriteableDirectory FilePathMonad
instance ReadableDirectory FilePathMonad
instance MonadPlus FilePathMonad
instance Monad FilePathMonad
instance Functor FilePathMonad
module SHA1
sha1PS :: ByteString -> String
module Darcs.Patch.Info
-- | A PatchInfo value contains the metadata of a patch. The date, name,
-- author and log fields are UTF-8 encoded text in darcs 2.4 and later,
-- and just sequences of bytes (decoded with whatever is the locale when
-- displayed) in earlier darcs.
--
-- The members with names that start with '_' are not supposed to be used
-- directly in code that does not care how the patch info is stored.
data PatchInfo
PatchInfo :: !ByteString -> !ByteString -> !ByteString -> ![ByteString] -> !Bool -> PatchInfo
_piDate :: PatchInfo -> !ByteString
_piName :: PatchInfo -> !ByteString
_piAuthor :: PatchInfo -> !ByteString
_piLog :: PatchInfo -> ![ByteString]
isInverted :: PatchInfo -> !Bool
patchinfo :: String -> String -> String -> [String] -> IO PatchInfo
invertName :: PatchInfo -> PatchInfo
idpatchinfo :: PatchInfo
-- | addJunk adds a line that contains a random number to make the patch
-- unique.
addJunk :: PatchInfo -> IO PatchInfo
makeFilename :: PatchInfo -> String
makeAltFilename :: PatchInfo -> String
readPatchInfo :: ByteString -> Maybe (PatchInfo, ByteString)
-- | Get the name, including an UNDO: prefix if the patch is
-- inverted.
justName :: PatchInfo -> String
-- | Returns the author of a patch.
justAuthor :: PatchInfo -> String
justLog :: PatchInfo -> String
repopatchinfo :: String -> PatchInfo -> RepoPatchInfo
data RepoPatchInfo
humanFriendly :: PatchInfo -> Doc
toXml :: PatchInfo -> Doc
piDate :: PatchInfo -> CalendarTime
setPiDate :: String -> PatchInfo -> PatchInfo
piDateString :: PatchInfo -> String
piDateBytestring :: PatchInfo -> ByteString
-- | Returns the name of the patch. Unlike justName, it does not
-- preprend UNDO: to the name if the patch is inverted.
piName :: PatchInfo -> String
piRename :: PatchInfo -> String -> PatchInfo
-- | Returns the author of a patch.
piAuthor :: PatchInfo -> String
-- | Get the tag name, if the patch is a tag patch.
piTag :: PatchInfo -> Maybe String
-- | Get the log message of a patch.
piLog :: PatchInfo -> [String]
-- | Patch is stored between square brackets.
--
--
-- [ <patch name>
-- <patch author>*<patch date>
-- <patch log (may be empty)> (indented one)
-- <can have multiple lines in patch log,>
-- <as long as they're preceded by a space>
-- <and don't end with a square bracket.>
-- ]
--
--
-- note that below I assume the name has no newline in it.
showPatchInfo :: PatchInfo -> Doc
isTag :: PatchInfo -> Bool
instance Eq PatchInfo
instance Ord PatchInfo
instance Show PatchInfo
instance HTML RepoPatchInfo
module Darcs.PopulationData
-- | the population of a darcs repository (simpler Slurpy)
data Population
Pop :: PatchInfo -> PopTree -> Population
-- | the state when last modified
popState :: Population -> PatchInfo
-- | the directory listing
popTree :: Population -> PopTree
-- | directory listing
data PopTree
PopDir :: !Info -> ![PopTree] -> PopTree
PopFile :: !Info -> PopTree
data Info
Info :: !ByteString -> !PatchInfo -> !DirMark -> !Maybe PatchInfo -> !Maybe ByteString -> Info
-- | name of the element
nameI :: Info -> !ByteString
-- | last patch modifying this element
modifiedByI :: Info -> !PatchInfo
-- | how was it modified
modifiedHowI :: Info -> !DirMark
-- | this can be unknown when restored backwards!
createdByI :: Info -> !Maybe PatchInfo
-- | the original name of the element
creationNameI :: Info -> !Maybe ByteString
setPopState :: PatchInfo -> Population -> Population
-- | was an Info record not modified?
notModified :: Info -> Bool
-- | set the modifier for an Info record
setState :: Info -> PatchInfo -> Info
-- | info of a directory member
data DirMark
AddedFile :: DirMark
RemovedFile :: DirMark
MovedFile :: String -> DirMark
ModifiedFile :: DirMark
DullFile :: DirMark
AddedDir :: DirMark
RemovedDir :: DirMark
MovedDir :: !String -> DirMark
DullDir :: DirMark
-- | read the population from a given directory dirname all
-- folders and documents get the given time t
--
-- This needs to be here in order to avoid a circular dependency between
-- Population and Pristine.
getPopFrom :: FilePath -> PatchInfo -> IO Population
instance Ord Info
instance Eq Info
instance Ord DirMark
instance Eq DirMark
instance Ord PopTree
instance Eq PopTree
instance Show Population
instance Eq Population
instance Show DirMark
instance Show Info
instance Show PopTree
module Darcs.Patch.Core
data Patch
PP :: Prim -> Patch
ComP :: FL Patch -> Patch
Merger :: Patch -> RL Patch -> Patch -> Patch -> Patch
Regrem :: Patch -> RL Patch -> Patch -> Patch -> Patch
-- | The Named type adds a patch info about a patch, that is a
-- name.
--
-- NamedP info deps p represents patch p with name
-- info. deps is a list of dependencies added at the
-- named patch level, compared with the unnamed level (ie, dependencies
-- added with darcs record --ask-deps).
data Named p
NamedP :: !PatchInfo -> ![PatchInfo] -> !p -> Named p
joinPatchesFL :: FL Patch -> Patch
concatFL :: FL (FL a) -> FL a
flattenFL :: Patch -> FL Patch
nullP :: Patch -> EqCheck
isNullPatch :: Patch -> Bool
infopatch :: (Patchy p) => PatchInfo -> p -> Named p
nFn :: FilePath -> FilePath
adddeps :: Named p -> [PatchInfo] -> Named p
namepatch :: (Patchy p) => String -> String -> String -> [String] -> p -> IO (Named p)
anonymous :: (Patchy p) => p -> IO (Named p)
mergerUndo :: Patch -> Patch
isMerger :: Patch -> Bool
getdeps :: Named p -> [PatchInfo]
patch2patchinfo :: Named p -> PatchInfo
patchname :: Named p -> String
patchcontents :: Named p -> p
instance (Effect p) => Effect (Named p)
instance FromPrim Patch
module Darcs.Patch.Show
showPatch_ :: Patch -> Doc
showNamedPrefix :: PatchInfo -> [PatchInfo] -> Doc
instance Show2 Patch
instance Show Patch
module Darcs.Patch.Commute
fromPrims :: (FromPrims p) => FL Prim -> p
-- | modernizePatch is used during conversion to Darcs 2 format.
-- It does the following:
--
--
-- - removes mergers by linearising them, thus removing the ability to
-- commute them
-- - drops mv a b ; add b which was introduced by an error in earlier
-- versions of darcs (TODO: check this; identify the versions)
--
modernizePatch :: Patch -> Patch
merge :: (Commute p) => (p :\/: p) -> (p :/\: p)
elegantMerge :: (Patch :\/: Patch) -> Maybe ((Patch :/\: Patch))
merger :: String -> Patch -> Patch -> Sealed (Patch)
unravel :: Patch -> [Sealed (FL Prim)]
publicUnravel :: Patch -> [Sealed (FL Prim)]
mangleUnravelled :: [Sealed (FL Prim)] -> Sealed (FL Prim)
type CommuteFunction = (Patch :< Patch) -> Perhaps ((Patch :< Patch))
data Perhaps a
Unknown :: Perhaps a
Failed :: Perhaps a
Succeeded :: a -> Perhaps a
toMaybe :: Perhaps a -> Maybe a
instance (MyEq p) => MyEq (Named p)
instance MyEq Patch
instance Invert Patch
instance (Invert p) => Invert (Named p)
instance FromPrims Patch
instance Effect Patch
instance Conflict Patch
instance Commute Patch
instance (Conflict p) => Conflict (Named p)
instance (Commute p) => Commute (Named p)
instance MonadPlus Perhaps
instance Monad Perhaps
module Darcs.Patch.Read
readPrim :: (ParserM m) => FileNameFormat -> m (Maybe (Sealed (Prim)))
readPatch :: (ReadPatch p) => ByteString -> Maybe (Sealed (p), ByteString)
instance ReadPatch Patch
instance ReadPatch Prim
instance (ReadPatch p) => ReadPatch (Named p)
module Darcs.Repository.Cache
-- | cacheHash computes the cache hash (i.e. filename) of a packed
-- string.
cacheHash :: ByteString -> String
okayHash :: String -> Bool
takeHash :: ByteString -> Maybe (String, ByteString)
newtype Cache
Ca :: [CacheLoc] -> Cache
data CacheType
Repo :: CacheType
Directory :: CacheType
data CacheLoc
Cache :: !CacheType -> !WritableOrNot -> !String -> CacheLoc
data WritableOrNot
Writable :: WritableOrNot
NotWritable :: WritableOrNot
data HashedDir
HashedPristineDir :: HashedDir
HashedPatchesDir :: HashedDir
HashedInventoriesDir :: HashedDir
hashedDir :: HashedDir -> String
unionCaches :: Cache -> Cache -> Cache
-- | unionRemoteCaches merges caches. It tries to do better than just
-- blindly copying remote cache entries:
--
--
-- - If remote repository is accessed through network, do not copy any
-- cache entries from it. Taking local entries does not make sense and
-- using network entries can lead to darcs hang when it tries to get to
-- unaccessible host.
-- - If remote repositoty is local, copy all network cache entries. For
-- local cache entries if the cache directory exists and is writable it
-- is added as writable cache, if it exists but is not writable it is
-- added as read-only cache.
--
--
-- This approach should save us from bogus cache entries. One case it
-- does not work very well is when you fetch from partial repository over
-- network. Hopefully this is not a common case.
unionRemoteCaches :: Cache -> Cache -> String -> IO (Cache)
cleanCaches :: Cache -> HashedDir -> IO ()
cleanCachesWithHint :: Cache -> HashedDir -> [String] -> IO ()
fetchFileUsingCache :: Cache -> HashedDir -> String -> IO (String, ByteString)
-- | speculateFileUsingCache cache subdirectory name takes note
-- that the file name is likely to be useful soon: pipelined
-- downloads will add it to the (low-priority) queue, for the rest it is
-- a noop.
speculateFileUsingCache :: Cache -> HashedDir -> String -> IO ()
-- | Note that the files are likely to be useful soon: pipelined downloads
-- will add them to the (low-priority) queue, for the rest it is a noop.
speculateFilesUsingCache :: Cache -> HashedDir -> [String] -> IO ()
-- | writeFileUsingCache cache compression subdir contents write
-- the string contents to the directory subdir, except if it is
-- already in the cache, in which case it is a noop. Warning (?) this
-- means that in case of a hash collision, writing using
-- writeFileUsingCache is a noop. The returned value is the filename that
-- was given to the string.
writeFileUsingCache :: Cache -> Compression -> HashedDir -> ByteString -> IO String
-- | peekInCache cache subdir hash tells whether cache
-- and contains an object with hash hash in a writable position.
-- Florent: why do we want it to be in a writable position?
peekInCache :: Cache -> HashedDir -> String -> IO Bool
repo2cache :: String -> Cache
writable :: CacheLoc -> Bool
isthisrepo :: CacheLoc -> Bool
-- | hashedFilePath cachelocation subdir hash returns the physical
-- filename of hash hash in the subdir section of
-- cachelocation.
hashedFilePath :: CacheLoc -> HashedDir -> String -> String
allHashedDirs :: [HashedDir]
-- | Compares two caches, a remote cache is greater than a local one. The
-- order of the comparison is given by: local < http < ssh
compareByLocality :: CacheLoc -> CacheLoc -> Ordering
instance Eq FromWhere
instance Eq OrOnlySpeculate
instance Eq CacheType
instance Show CacheType
instance Show WritableOrNot
instance Show Cache
instance Show CacheLoc
instance Eq CacheLoc
module Darcs.Repository.Prefs
addToPreflist :: (WriteableDirectory m) => String -> String -> m ()
getPreflist :: (ReadableDirectory m) => String -> m [String]
setPreflist :: (WriteableDirectory m) => String -> [String] -> m ()
getGlobal :: String -> IO [String]
environmentHelpHome :: ([String], [String])
defaultrepo :: [DarcsFlag] -> AbsolutePath -> [String] -> IO [String]
setDefaultrepo :: String -> [DarcsFlag] -> IO ()
getPrefval :: (ReadableDirectory m) => String -> m (Maybe String)
setPrefval :: (WriteableDirectory m) => String -> String -> m ()
changePrefval :: (WriteableDirectory m) => String -> String -> String -> m ()
defPrefval :: String -> String -> IO String
-- | .[^/] ^_ ~$ (^|)CVS($|) end{verbatim} A newly created
-- repository has a longer boring file that includes many common source
-- control, backup, temporary, and compiled files.
--
-- You may want to have the boring file under version control. To do this
-- you can use darcs setpref to set the value `boringfile' to
-- the name of your desired boring file (e.g. verb-darcs setpref
-- boringfile .boring-, where verb-.boring- is the repository path of a
-- file that has been darcs added to your repository). The boringfile
-- preference overrides verb!_darcsprefsboring!, so be sure to
-- copy that file to the boringfile.
--
-- You can also set up a `boring' regexps file in your home
-- directory, named verb!~.darcsboring!, on MS
-- Windows~ref{ms_win}, which will be used with all of your darcs
-- repositories.
--
-- Any file not already managed by darcs and whose repository path (such
-- as verb!manual/index.html!) matches any of the boring regular
-- expressions is considered boring. The boring file is used to filter
-- the files provided to darcs add, to allow you to use a simple
-- verb-darcs add newdir newdir-\verb-*- % cabal haddock barfs on
-- adjacent * without accidentally adding a bunch of object files.
-- It is also used when the verb!--look-for-adds! flag is given to
-- whatsnew or record. Note that once a file has been added to darcs, it
-- is not considered boring, even if it matches the boring file filter.
writeDefaultPrefs :: IO ()
boringRegexps :: IO [Regex]
boringFileFilter :: IO ([FilePath] -> [FilePath])
darcsdirFilter :: [FilePath] -> [FilePath]
data FileType
BinaryFile :: FileType
TextFile :: FileType
filetypeFunction :: IO (FilePath -> FileType)
getCaches :: [DarcsFlag] -> String -> IO Cache
binariesFileHelp :: [String]
globalCacheDir :: IO (Maybe FilePath)
instance Eq FileType
module Darcs.Patch.Apply
applyToFilepaths :: (Apply p) => p -> [FilePath] -> [FilePath]
forceTokReplace :: String -> String -> String -> FileContents -> Maybe FileContents
markupFile :: (Effect p) => PatchInfo -> p -> (FilePath, MarkedUpFile) -> (FilePath, MarkedUpFile)
emptyMarkedupFile :: MarkedUpFile
patchChanges :: Prim -> [(String, DirMark)]
applyToPop :: PatchInfo -> FL Prim -> Population -> Population
-- | Apply a patch to a Tree, yielding a new Tree.
applyToTree :: (Apply p) => p -> Tree IO -> IO (Tree IO)
data LineMark
AddedLine :: PatchInfo -> LineMark
RemovedLine :: PatchInfo -> LineMark
AddedRemovedLine :: PatchInfo -> PatchInfo -> LineMark
None :: LineMark
type MarkedUpFile = [(ByteString, LineMark)]
instance Show LineMark
instance Apply Prim
instance Apply Patch
instance (Apply p) => Apply (Named p)
module Darcs.Patch.Viewing
xmlSummary :: (Effect p, Patchy p, Conflict p) => Named p -> Doc
plainSummary :: (Conflict e, Effect e) => e -> Doc
instance Ord SummOp
instance Eq SummOp
instance Ord SummDetail
instance Eq SummDetail
instance Ord SummChunk
instance Eq SummChunk
instance (Conflict p, Patchy p) => Patchy (RL p)
instance (Conflict p, Patchy p) => Patchy (FL p)
instance (Conflict p, Apply p, ShowPatch p) => ShowPatch (RL p)
instance (Conflict p, Apply p, Effect p, ShowPatch p) => ShowPatch (FL p)
instance (Conflict p, ShowPatch p) => Show (Named p)
instance (Conflict p, ShowPatch p) => ShowPatch (Named p)
instance ShowPatch Patch
instance ShowPatch Prim
module Darcs.Patch.Split
-- | A splitter is something that can take a patch and (possibly) render it
-- as text in some format of its own choosing. This text can then be
-- presented to the user for editing, and the result given to the
-- splitter for parsing. If the parse succeeds, the result is a list of
-- patches that could replace the original patch in any context.
-- Typically this list will contain the changed version of the patch,
-- along with fixup pieces to ensure that the overall effect of the list
-- is the same as the original patch. The individual elements of the list
-- can then be offered separately to the user, allowing them to accept
-- some and reject others.
--
-- There's no immediate application for a splitter for anything other
-- than Prim (you shouldn't go editing named patches, you'll break them!)
-- However you might want to compose splitters for FilePatchType to make
-- splitters for Prim etc, and the generality doesn't cost anything.
data Splitter p
Splitter :: (p -> Maybe (ByteString, ByteString -> Maybe (FL p))) -> (FL p -> FL p) -> Splitter p
applySplitter :: Splitter p -> p -> Maybe (ByteString, ByteString -> Maybe (FL p))
canonizeSplit :: Splitter p -> FL p -> FL p
-- | This generic splitter just lets the user edit the printed
-- representation of the patch Should not be used expect for testing and
-- experimentation.
rawSplitter :: (ShowPatch p, ReadPatch p, Invert p) => Splitter p
-- | Never splits. In other code we normally pass around Maybe Splitter
-- instead of using this as the default, because it saves clients that
-- don't care about splitting from having to import this module just to
-- get noSplitter.
noSplitter :: Splitter p
-- | Split a primitive hunk patch up by allowing the user to edit both the
-- before and after lines, then insert fixup patches to clean up the
-- mess.
primSplitter :: Splitter Prim
-- | NonPatch and Non patches are patches that store a
-- context as a sequence of patches. See Darcs.Patch.Real for
-- example usage.
module Darcs.Patch.Non
-- | Non stores a context with a Prim patch.
data Non p
Non :: FL p -> Prim -> Non p
class Nonable p
non :: (Nonable p) => p -> Non p
-- | Return as a list the context followed by the primitive patch.
unNon :: (FromPrim p) => Non p -> Sealed (FL p)
showNon :: (ShowPatch (FL p)) => Non p -> Doc
readNon :: (ReadPatch p, ParserM m) => m (Maybe (Non p))
showNons :: (ShowPatch (FL p)) => [Non p] -> Doc
readNons :: (ReadPatch p, ParserM m) => m [Non p]
add :: (Effect q, Patchy p, ToFromPrim p) => q -> Non p -> Non p
rem :: (Effect q, Patchy p, ToFromPrim p) => q -> Non p -> Maybe (Non p)
-- | addP x cy tries to commute x past cy
-- and always returns some variant cy'. -- commutation suceeds,
-- the variant is just straightforwardly the commuted versian. If
-- commutation fails, the variant consists of x prepended to the
-- context of cy.
addP :: (Patchy p, ToFromPrim p) => p -> Non p -> Non p
remP :: (Patchy p, ToFromPrim p) => p -> Non p -> Maybe (Non p)
-- | addPs xs cy commutes as many patches of xs
-- past cy as possible, stopping at the first patch that fails
-- to commute. Note the fact xs is a RL
--
-- Suppose we have
--
--
-- x1 x2 x3 [c1 c2 y]
--
--
-- and that in our example c1 fails to commute past x1,
-- this function would commute down to
--
--
-- x1 [c1'' c2'' y''] x2' x3'
--
--
-- and return [x1 c1'' c2'' y'']
addPs :: (Patchy p, ToFromPrim p) => RL p -> Non p -> Non p
remPs :: (Patchy p, ToFromPrim p) => FL p -> Non p -> Maybe (Non p)
remAddP :: (Patchy p, ToFromPrim p) => p -> Non p -> Non p
remAddPs :: (Patchy p, ToFromPrim p) => RL p -> Non p -> Non p
remNons :: (Nonable p, Effect p, Patchy p, ToFromPrim p, ShowPatch p) => [Non p] -> Non p -> Non p
(*>) :: (Patchy p, ToFromPrim p) => Non p -> p -> Maybe (Non p)
(>*) :: (Patchy p, ToFromPrim p) => p -> Non p -> Maybe (Non p)
(*>>) :: (Effect q, Patchy q, Patchy p, ToFromPrim p) => Non p -> q -> Maybe (Non p)
(>>*) :: (Effect q, Patchy p, ToFromPrim p) => q -> Non p -> Maybe (Non p)
propAdjustTwice :: (Patchy p, ToFromPrim p) => p -> Non p -> Maybe Doc
instance Patchy Prim
instance (Show2 p) => Show1 (Non p)
instance (Show2 p) => Show (Non p)
instance Nonable Prim
instance (Commute p, MyEq p) => Eq (Non p)
-- | Conflictor patches
module Darcs.Patch.Real
-- | Duplicate x: This patch has no effect since x is
-- already present in the repository
--
--
-- Etacilpud x: invert (Duplicate x)
--
--
-- Normal prim: A primitive patch
--
-- Conflictor ix xx x: ix is the set of patches:
--
--
-- - that conflict with x and also conflict with another patch
-- in the repository
-- - that conflict with a patch that conflict with x
--
--
-- xx is the sequence of patches that conflict *only* with
-- x
--
-- x is the current patch
--
-- ix and x are stored as Non objects, which
-- include any necessary context to uniquely define the patch that is
-- referred to.
--
-- InvConflictor ix xx x: like invert (Conflictor ix xx
-- x)
data RealPatch
Duplicate :: Non RealPatch -> RealPatch
Etacilpud :: Non RealPatch -> RealPatch
Normal :: Prim -> RealPatch
Conflictor :: [Non RealPatch] -> FL Prim -> Non RealPatch -> RealPatch
InvConflictor :: [Non RealPatch] -> FL Prim -> Non RealPatch -> RealPatch
prim2real :: Prim -> RealPatch
-- | This is used for unit-testing and for internal sanity checks
isConsistent :: RealPatch -> Maybe Doc
-- | This is only used for unit testing
isForward :: RealPatch -> Maybe Doc
-- | isDuplicate p is ' True if p is
-- either a Duplicate or Etacilpud patch
isDuplicate :: RealPatch -> Bool
-- | pullCommon xs ys returns the set of patches that can
-- be commuted out of both xs and ys along with the
-- remnants of both lists
pullCommon :: (Patchy p) => FL p -> FL p -> Common p
mergeUnravelled :: [Sealed ((FL Prim))] -> Maybe (FlippedSeal RealPatch)
instance Effect RealPatch
instance Nonable RealPatch
instance Show2 RealPatch
instance Show RealPatch
instance ReadPatch RealPatch
instance ShowPatch RealPatch
instance Apply RealPatch
instance Commute RealPatch
instance Invert RealPatch
instance MyEq RealPatch
instance ToFromPrim RealPatch
instance FromPrim RealPatch
instance Conflict RealPatch
instance Patchy RealPatch
module Darcs.Patch
class (Patchy p, Effect p, FromPrims p, Conflict p) => RepoPatch p
data Prim
data Patch
-- | Duplicate x: This patch has no effect since x is
-- already present in the repository
--
--
-- Etacilpud x: invert (Duplicate x)
--
--
-- Normal prim: A primitive patch
--
-- Conflictor ix xx x: ix is the set of patches:
--
--
-- - that conflict with x and also conflict with another patch
-- in the repository
-- - that conflict with a patch that conflict with x
--
--
-- xx is the sequence of patches that conflict *only* with
-- x
--
-- x is the current patch
--
-- ix and x are stored as Non objects, which
-- include any necessary context to uniquely define the patch that is
-- referred to.
--
-- InvConflictor ix xx x: like invert (Conflictor ix xx
-- x)
data RealPatch
-- | The Named type adds a patch info about a patch, that is a
-- name.
--
-- NamedP info deps p represents patch p with name
-- info. deps is a list of dependencies added at the
-- named patch level, compared with the unnamed level (ie, dependencies
-- added with darcs record --ask-deps).
data Named p
class (Apply p, Commute p, ShowPatch p, ReadPatch p, Invert p) => Patchy p
flattenFL :: Patch -> FL Patch
joinPatches :: (FromPrims p) => FL p -> p
fromPrim :: (FromPrim p) => Prim -> p
fromPrims :: (FromPrims p) => FL Prim -> p
isNullPatch :: Patch -> Bool
nullP :: Patch -> EqCheck
rmfile :: FilePath -> Prim
addfile :: FilePath -> Prim
rmdir :: FilePath -> Prim
adddir :: FilePath -> Prim
move :: FilePath -> FilePath -> Prim
hunk :: FilePath -> Int -> [ByteString] -> [ByteString] -> Prim
tokreplace :: FilePath -> String -> String -> String -> Prim
namepatch :: (Patchy p) => String -> String -> String -> [String] -> p -> IO (Named p)
anonymous :: (Patchy p) => p -> IO (Named p)
binary :: FilePath -> ByteString -> ByteString -> Prim
description :: (ShowPatch p) => p -> Doc
showContextPatch :: (ShowPatch p) => p -> TreeIO Doc
showPatch :: (ShowPatch p) => p -> Doc
showNicely :: (ShowPatch p) => p -> Doc
infopatch :: (Patchy p) => PatchInfo -> p -> Named p
changepref :: String -> String -> String -> Prim
thing :: (ShowPatch p) => p -> String
things :: (ShowPatch p) => p -> String
-- | Tells you if two patches are in the same category, human-wise.
-- Currently just returns true if they are filepatches on the same file.
isSimilar :: Prim -> Prim -> Bool
primIsAddfile :: Prim -> Bool
primIsHunk :: Prim -> Bool
primIsSetpref :: Prim -> Bool
isMerger :: Patch -> Bool
merge :: (Commute p) => (p :\/: p) -> (p :/\: p)
commute :: (Commute p) => (p :> p) -> Maybe ((p :> p))
listTouchedFiles :: (Commute p) => p -> [FilePath]
hunkMatches :: (Commute p) => (ByteString -> Bool) -> p -> Bool
elegantMerge :: (Patch :\/: Patch) -> Maybe ((Patch :/\: Patch))
resolveConflicts :: (Conflict p) => p -> [[Sealed (FL Prim)]]
-- | Patches whose concrete effect which can be expressed as a list of
-- primitive patches.
--
-- A minimal definition would be either of effect or
-- effectRL.
class Effect p
effect :: (Effect p) => p -> FL Prim
primIsBinary :: Prim -> Bool
gzWritePatch :: (ShowPatch p) => FilePath -> p -> IO ()
writePatch :: (ShowPatch p) => FilePath -> p -> IO ()
primIsAdddir :: Prim -> Bool
invert :: (Invert p) => p -> p
invertFL :: (Invert p) => FL p -> RL p
invertRL :: (Invert p) => RL p -> FL p
identity :: (Invert p) => p
commuteFLorComplain :: (Commute p) => (p :> FL p) -> Either (Sealed2 p) ((FL p :> p))
commuteRL :: (Commute p) => (RL p :> p) -> Maybe ((p :> RL p))
readPatch :: (ReadPatch p) => ByteString -> Maybe (Sealed (p), ByteString)
canonize :: Prim -> FL Prim
-- | sortCoalesceFL ps coalesces as many patches in
-- ps as possible, sorting the results according to the scheme
-- defined in comparePrim
sortCoalesceFL :: FL Prim -> FL Prim
tryToShrink :: FL Prim -> FL Prim
patchname :: Named p -> String
patchcontents :: Named p -> p
applyToFilepaths :: (Apply p) => p -> [FilePath] -> [FilePath]
apply :: (Apply p, WriteableDirectory m) => [DarcsFlag] -> p -> m ()
-- | Apply a patch to a Tree, yielding a new Tree.
applyToTree :: (Apply p) => p -> Tree IO -> IO (Tree IO)
patch2patchinfo :: Named p -> PatchInfo
data LineMark
AddedLine :: PatchInfo -> LineMark
RemovedLine :: PatchInfo -> LineMark
AddedRemovedLine :: PatchInfo -> PatchInfo -> LineMark
None :: LineMark
type MarkedUpFile = [(ByteString, LineMark)]
markupFile :: (Effect p) => PatchInfo -> p -> (FilePath, MarkedUpFile) -> (FilePath, MarkedUpFile)
emptyMarkedupFile :: MarkedUpFile
summary :: (ShowPatch p) => p -> Doc
plainSummary :: (Conflict e, Effect e) => e -> Doc
xmlSummary :: (Effect p, Patchy p, Conflict p) => Named p -> Doc
adddeps :: Named p -> [PatchInfo] -> Named p
getdeps :: Named p -> [PatchInfo]
listConflictedFiles :: (Conflict p) => p -> [FilePath]
-- | modernizePatch is used during conversion to Darcs 2 format.
-- It does the following:
--
--
-- - removes mergers by linearising them, thus removing the ability to
-- commute them
-- - drops mv a b ; add b which was introduced by an error in earlier
-- versions of darcs (TODO: check this; identify the versions)
--
modernizePatch :: Patch -> Patch
isInconsistent :: (Conflict p) => p -> Maybe Doc
-- | info of a directory member
data DirMark
AddedFile :: DirMark
RemovedFile :: DirMark
MovedFile :: String -> DirMark
ModifiedFile :: DirMark
DullFile :: DirMark
AddedDir :: DirMark
RemovedDir :: DirMark
MovedDir :: !String -> DirMark
DullDir :: DirMark
patchChanges :: Prim -> [(String, DirMark)]
applyToPop :: PatchInfo -> FL Prim -> Population -> Population
instance (RepoPatchBase p) => RepoPatch (FL p)
instance RepoPatch Patch
instance RepoPatchBase RealPatch
instance RepoPatchBase Patch
instance (Conflict p, Effect p, Patchy p) => Patchy (Named p)
instance Patchy Patch
module Darcs.Hopefully
-- | Hopefully p C (x y) is Either
-- String (p C (x y)) in a form adapted to darcs patches.
-- The C (x y) represents the type witness for the
-- patch that should be there. The Hopefully type just tells
-- whether we expect the patch to be hashed or not, and
-- SimpleHopefully does the real work of emulating Either.
-- Hopefully sh represents an expected unhashed patch, and
-- Hashed hash sh represents an expected hashed patch with its
-- hash.
data Hopefully a
-- | PatchInfoAnd p represents a hope we have to get a
-- patch through its info. We're not sure we have the patch, but we know
-- its info.
data PatchInfoAnd p
-- | WPatchInfo represents the info of a patch, marked
-- with the patch's witnesses.
data WPatchInfo
unWPatchInfo :: WPatchInfo -> PatchInfo
compareWPatchInfo :: WPatchInfo -> WPatchInfo -> EqCheck
-- | piap i p creates a PatchInfoAnd containing p with info
-- i.
piap :: PatchInfo -> Named p -> PatchInfoAnd p
-- | n2pia creates a PatchInfoAnd representing a Named
-- patch.
n2pia :: Named p -> PatchInfoAnd p
patchInfoAndPatch :: PatchInfo -> Hopefully (Named p) -> PatchInfoAnd p
-- | conscientiously er hp tries to extract a patch from a
-- PatchInfoAnd. If it fails, it applies the error handling
-- function er to a description of the patch info component of
-- hp.
conscientiously :: (Doc -> Doc) -> PatchInfoAnd p -> Named p
-- | hopefully hp tries to get a patch from a
-- PatchInfoAnd value. If it fails, it outputs an error "failed to
-- read patch: <description of the patch>". We get the description
-- of the patch from the info part of hp
hopefully :: PatchInfoAnd p -> Named p
info :: PatchInfoAnd p -> PatchInfo
winfo :: PatchInfoAnd p -> WPatchInfo
-- | hopefullyM is a version of hopefully which calls
-- fail in a monad instead of erroring.
hopefullyM :: (Monad m) => PatchInfoAnd p -> m (Named p)
createHashed :: String -> (String -> IO (Sealed (a))) -> IO (Sealed (Hopefully a))
extractHash :: PatchInfoAnd p -> Either (Named p) String
actually :: a -> Hopefully a
unavailable :: String -> Hopefully a
patchDesc :: PatchInfoAnd p -> String
instance (RepoPatch p) => Patchy (PatchInfoAnd p)
instance (Conflict p) => Conflict (PatchInfoAnd p)
instance (Effect p) => Effect (PatchInfoAnd p)
instance (ReadPatch p) => ReadPatch (PatchInfoAnd p)
instance (Apply p) => Apply (PatchInfoAnd p)
instance (Commute p) => Commute (PatchInfoAnd p)
instance (Conflict p, Effect p, ShowPatch p) => ShowPatch (PatchInfoAnd p)
instance (Invert p) => Invert (PatchInfoAnd p)
instance (MyEq p) => MyEq (PatchInfoAnd p)
instance MyEq WPatchInfo
module Darcs.Patch.Set
data PatchSet p
PatchSet :: RL (PatchInfoAnd p) -> RL (Tagged p) -> PatchSet p
data Tagged p
Tagged :: PatchInfoAnd p -> Maybe String -> RL (PatchInfoAnd p) -> Tagged p
type SealedPatchSet p = Sealed ((PatchSet p))
data Origin
progressPatchSet :: String -> PatchSet p -> PatchSet p
tags :: PatchSet p -> [PatchInfo]
newset2RL :: PatchSet p -> RL (PatchInfoAnd p)
newset2FL :: PatchSet p -> FL (PatchInfoAnd p)
module Darcs.ProgressPatches
-- | Evaluate an RL list and report progress.
progressRL :: String -> RL a -> RL a
-- | Evaluate an FL list and report progress.
progressFL :: String -> FL a -> FL a
-- | Evaluate an RL list and report progress. In addition to
-- printing the number of patches we got, show the name of the last tag
-- we got.
progressRLShowTags :: String -> RL (PatchInfoAnd p) -> RL (PatchInfoAnd p)
module Darcs.CommandsAux
-- | A convenience function to call from all darcs command functions before
-- applying any patches. It checks for malicious paths in patches, and
-- prints an error message and fails if it finds one.
checkPaths :: (Patchy p) => [DarcsFlag] -> FL p -> IO ()
-- | Filter out patches that contains some malicious file path
maliciousPatches :: (Patchy p) => [Sealed2 p] -> [Sealed2 p]
hasMaliciousPath :: (Patchy p) => p -> Bool
module Darcs.Patch.Depends
getTagsRight :: PatchSet p -> [PatchInfo]
areUnrelatedRepos :: (RepoPatch p) => PatchSet p -> PatchSet p -> Bool
mergeThem :: (RepoPatch p) => PatchSet p -> PatchSet p -> Sealed (FL (PatchInfoAnd p))
findCommonWithThem :: (RepoPatch p) => PatchSet p -> PatchSet p -> (PatchSet p :>> FL (PatchInfoAnd p))
countUsThem :: (RepoPatch p) => PatchSet p -> PatchSet p -> (Int, Int)
removeFromPatchSet :: (RepoPatch p) => FL (PatchInfoAnd p) -> PatchSet p -> Maybe (PatchSet p)
optimizePatchset :: PatchSet p -> PatchSet p
deepOptimizePatchset :: PatchSet p -> PatchSet p
slightlyOptimizePatchset :: PatchSet p -> PatchSet p
getPatchesBeyondTag :: (RepoPatch p) => PatchInfo -> PatchSet p -> FlippedSeal (RL (PatchInfoAnd p))
-- | getPatchesInTag t ps returns a SealedPatchSet of all
-- patches in ps which are contained in t.
getPatchesInTag :: (RepoPatch p) => PatchInfo -> PatchSet p -> SealedPatchSet p
splitOnTag :: (RepoPatch p) => PatchInfo -> PatchSet p -> (PatchSet p :>> RL (PatchInfoAnd p))
newsetUnion :: (RepoPatch p) => [SealedPatchSet p] -> SealedPatchSet p
newsetIntersection :: (RepoPatch p) => [SealedPatchSet p] -> SealedPatchSet p
commuteToEnd :: (RepoPatch p) => RL (PatchInfoAnd p) -> PatchSet p -> (PatchSet p :>> RL (PatchInfoAnd p))
findUncommon :: (RepoPatch p) => PatchSet p -> PatchSet p -> (FL (PatchInfoAnd p) :\/: FL (PatchInfoAnd p))
-- | Merge two FLs (say L and R), starting in a common context. The result
-- is a FL starting in the original end context of L, going to a new
-- context that is the result of applying all patches from R on top of
-- patches from L.
--
-- While this function is similar to mergeFL, there are three
-- important differences to keep in mind:
--
--
-- - mergeFL does not correctly deal with duplicate patches
-- whereas this one does (Question from Eric Kow: in what sense? Why not
-- fix the mergeFL instance?)
-- - mergeFL returns both paths of the merge diamond, but this
-- version only returns one, so you'd better choose the order carefully,
-- eg. (merge2FL l r)
-- - The conventional order we use in this function is reversed from
-- mergeFL (so mergeFL r l vs. merge2FL l r.
-- This does not matter so much for the former since you get both paths.
-- (Question from Eric Kow: should we flip merge2FL for more uniformity
-- in the code?)
--
merge2FL :: (RepoPatch p) => FL (PatchInfoAnd p) -> FL (PatchInfoAnd p) -> Sealed (FL (PatchInfoAnd p))
module Darcs.Patch.Bundle
hashBundle :: (RepoPatch p) => [PatchInfo] -> FL (Named p) -> String
makeBundle :: (RepoPatch p) => Maybe (Tree IO) -> RL (PatchInfoAnd p) -> FL (Named p) -> IO Doc
-- | In makeBundle2, it is presumed that the two patch sequences are
-- identical, but that they may be lazily generated. If two different
-- patch sequences are passed, a bundle with a mismatched hash will be
-- generated, which is not the end of the world, but isn't very useful
-- either.
makeBundle2 :: (RepoPatch p) => Maybe (Tree IO) -> RL (PatchInfoAnd p) -> FL (Named p) -> FL (Named p) -> IO Doc
makeBundleN :: (RepoPatch p) => Maybe (Tree IO) -> PatchSet p -> FL (Named p) -> IO Doc
scanBundle :: (RepoPatch p) => ByteString -> Either String (SealedPatchSet p)
contextPatches :: (RepoPatch p) => PatchSet p -> FlippedSeal (RL (PatchInfoAnd p))
scanContext :: (RepoPatch p) => ByteString -> PatchSet p
patchFilename :: String -> String
module Darcs.Diff
treeDiff :: (Functor m, Monad m, Gap w) => (FilePath -> FileType) -> Tree m -> Tree m -> m (w (FL Prim))
module Darcs.Repository.ApplyPatches
applyPatches :: (Patchy p) => [DarcsFlag] -> FL (PatchInfoAnd p) -> IO ()
applyPatchesWithFeedback :: (Patchy p) => [DarcsFlag] -> String -> FL (PatchInfoAnd p) -> IO ()
module Darcs.Patch.Match
data PatchMatch
-- | A Matcher is made of a MatchFun which we will use to
-- match patches and a String representing it.
data Matcher p
-- | A type for predicates over patches which do not care about contexts
type MatchFun p = Sealed2 (PatchInfoAnd p) -> Bool
patchMatch :: String -> PatchMatch
matchPattern :: (Patchy p) => PatchMatch -> Matcher p
-- | applyMatcher applies a matcher to a patch.
applyMatcher :: Matcher p -> PatchInfoAnd p -> Bool
makeMatcher :: String -> (Sealed2 (PatchInfoAnd p) -> Bool) -> Matcher p
parseMatch :: (Patchy p) => PatchMatch -> Either String (MatchFun p)
matchParser :: (Patchy p) => CharParser st (MatchFun p)
-- | The string that is emitted when the user runs darcs help
-- --match.
helpOnMatchers :: String
instance Show (Matcher p)
module Darcs.Resolution
standardResolution :: (RepoPatch p) => p -> Sealed (FL Prim)
externalResolution :: (RepoPatch p) => Tree IO -> String -> FL Prim -> FL Prim -> p -> IO (Sealed (FL Prim))
patchsetConflictResolutions :: (RepoPatch p) => PatchSet p -> Sealed (FL Prim)
-- | PatchChoices divides a sequence of patches into three sets:
-- first, middle and last, such that all patches can
-- be applied, if you first apply the first ones then the middle ones and
-- then the last ones. Obviously if there are dependencies between the
-- patches that will put a constraint on how you can choose to divide
-- them up. The PatchChoices data type and associated functions are here
-- to deal with many of the common cases that come up when choosing a
-- subset of a group of patches.
--
-- forceLast tells PatchChoices that a particular patch is
-- required to be in the last group, which also means that any
-- patches that depend on it must be in the last group.
--
-- Internally, a PatchChoices doesn't always reorder the patches until it
-- is asked for the final output (e.g. by get_first_choice).
-- Instead, each patch is placed in a state of definitely first,
-- definitely last and undecided; undecided leans towards middle.
-- The patches that are first are commuted to the head immediately, but
-- patches that are middle and last are mixed together. In case you're
-- wondering about the first-middle-last language, it's because in some
-- cases the yes answers will be last (as is the case for the
-- revert command), and in others first (as in record, pull and push).
--
-- Some patch marked middle may in fact be unselectable because of
-- dependencies: when a patch is marked last, its dependencies are
-- not updated until patchSlot is called on them.
module Darcs.Patch.Choices
data PatchChoices p
patchChoices :: (Patchy p) => FL p -> PatchChoices p
-- | Tag a sequence of patches.
patchChoicesTps :: (Patchy p) => FL p -> (PatchChoices p, FL (TaggedPatch p))
-- | Tag a sequence of patches as subpatches of an existing tag. This is
-- intended for use when substituting a patch for an equivalent patch or
-- patches.
patchChoicesTpsSub :: (Patchy p) => Maybe Tag -> FL p -> (PatchChoices p, FL (TaggedPatch p))
patchSlot :: (Patchy p) => TaggedPatch p -> PatchChoices p -> (Slot, PatchChoices p)
patchSlot' :: (Patchy p) => TaggedPatch p -> State (PatchChoices p) Slot
-- | getChoices evaluates a PatchChoices into the first,
-- middle and last sequences by doing the commutes that were needed.
getChoices :: (Patchy p) => PatchChoices p -> (FL (TaggedPatch p) :> (FL (TaggedPatch p) :> FL (TaggedPatch p)))
-- | refineChoices act performs act on the middle part of
-- a sequence of choices, in order to hopefully get more patches into the
-- first and last parts of a PatchChoices.
refineChoices :: (Patchy p, Monad m, Functor m) => (FL (TaggedPatch p) -> PatchChoices p -> m (PatchChoices p)) -> PatchChoices p -> m (PatchChoices p)
separateFirstMiddleFromLast :: (Patchy p) => PatchChoices p -> (FL (TaggedPatch p) :> FL (TaggedPatch p))
separateFirstFromMiddleLast :: (Patchy p) => PatchChoices p -> (FL (TaggedPatch p) :> FL (TaggedPatch p))
forceFirst :: (Patchy p) => Tag -> PatchChoices p -> PatchChoices p
forceFirsts :: (Patchy p) => [Tag] -> PatchChoices p -> PatchChoices p
forceLast :: (Patchy p) => Tag -> PatchChoices p -> PatchChoices p
forceLasts :: (Patchy p) => [Tag] -> PatchChoices p -> PatchChoices p
forceMatchingFirst :: (Patchy p) => (TaggedPatch p -> Bool) -> PatchChoices p -> PatchChoices p
forceMatchingLast :: (Patchy p) => (TaggedPatch p -> Bool) -> PatchChoices p -> PatchChoices p
selectAllMiddles :: (Patchy p) => Bool -> PatchChoices p -> PatchChoices p
makeUncertain :: (Patchy p) => Tag -> PatchChoices p -> PatchChoices p
makeEverythingLater :: (Patchy p) => PatchChoices p -> PatchChoices p
makeEverythingSooner :: (Patchy p) => PatchChoices p -> PatchChoices p
data TaggedPatch p
-- | TG mp i acts as a temporary identifier to help us keep
-- track of patches during the selection process. These are useful for
-- finding patches that may have moved around during patch selection
-- (being pushed forwards or backwards as dependencies arise).
--
-- The identifier is implemented as a tuple TG mp i. The
-- i is just some arbitrary label, expected to be unique within
-- the patches being scrutinised. The mp is motivated by patch
-- splitting; it provides a convenient way to generate a new identifier
-- from the patch being split. For example, if we split a patch
-- identified as TG Nothing 5, the resulting sub-patches could
-- be identified as TG (TG Nothing 5) 1, TG (TG Nothing 5)
-- 2, etc.
data Tag
tag :: TaggedPatch p -> Tag
tpPatch :: TaggedPatch p -> p
-- | See module documentation for Darcs.Patch.Choices
data Slot
InFirst :: Slot
InMiddle :: Slot
InLast :: Slot
-- | substitute (a :||: bs) pcs replaces
-- a with bs in pcs preserving the choice
-- associated with a
substitute :: (Patchy p) => Sealed2 (TaggedPatch p :||: FL (TaggedPatch p)) -> PatchChoices p -> PatchChoices p
instance Eq Tag
instance Ord Tag
instance (MyEq p) => MyEq (PatchChoice p)
instance (Commute p) => Commute (PatchChoice p)
instance (Commute p) => Commute (TaggedPatch p)
instance (Invert p) => Invert (TaggedPatch p)
instance (MyEq p) => MyEq (TaggedPatch p)
module Darcs.Patch.TouchesFiles
lookTouch :: (Patchy p) => [FilePath] -> p -> (Bool, [FilePath])
chooseTouching :: (Patchy p) => [FilePath] -> FL p -> Sealed (FL p)
choosePreTouching :: (Patchy p) => [FilePath] -> FL p -> Sealed (FL p)
selectTouching :: (Patchy p) => [FilePath] -> PatchChoices p -> PatchChoices p
deselectNotTouching :: (Patchy p) => [FilePath] -> PatchChoices p -> PatchChoices p
selectNotTouching :: (Patchy p) => [FilePath] -> PatchChoices p -> PatchChoices p
module Darcs.Patch.Properties
recommute :: (Patchy p) => (((p :> p) -> Maybe ((p :> p)))) -> (p :> p) -> Maybe Doc
commuteInverses :: (Patchy p) => ((p :> p) -> Maybe ((p :> p))) -> (p :> p) -> Maybe Doc
permutivity :: (Patchy p) => ((p :> p) -> Maybe ((p :> p))) -> (p :> (p :> p)) -> Maybe Doc
partialPermutivity :: (Patchy p) => ((p :> p) -> Maybe ((p :> p))) -> (p :> (p :> p)) -> Maybe Doc
identityCommutes :: (Patchy p) => p -> Maybe Doc
inverseDoesntCommute :: (Patchy p) => p -> Maybe Doc
patchAndInverseCommute :: (Patchy p) => ((p :> p) -> Maybe ((p :> p))) -> (p :> p) -> Maybe Doc
mergeEitherWay :: (Patchy p) => (p :\/: p) -> Maybe Doc
show_read :: (Show2 p, Patchy p) => p -> Maybe Doc
mergeCommute :: (Patchy p) => (p :\/: p) -> Maybe Doc
mergeConsistent :: (Patchy p) => (p -> Maybe Doc) -> (p :\/: p) -> Maybe Doc
mergeArgumentsConsistent :: (Patchy p) => (p -> Maybe Doc) -> (p :\/: p) -> Maybe Doc
joinInverses :: ((Prim :> Prim) -> Maybe (Prim)) -> Prim -> Maybe Doc
joinCommute :: ((Prim :> Prim) -> Maybe (Prim)) -> (Prim :> (Prim :> Prim)) -> Maybe Doc
module Darcs.Repository.InternalTypes
data Repository p
Repo :: !String -> ![DarcsFlag] -> !RepoFormat -> !RepoType p -> Repository
data RepoType p
DarcsRepository :: !Pristine -> Cache -> RepoType
data Pristine
NoPristine :: !String -> Pristine
PlainPristine :: !String -> Pristine
HashedPristine :: Pristine
extractCache :: Repository p -> Cache
extractOptions :: Repository p -> [DarcsFlag]
-- | modifyCache repository function modifies the cache of
-- repository with function, remove duplicates and sort
-- the results with compareByLocality.
modifyCache :: (RepoPatch p) => Repository p -> (Cache -> Cache) -> Repository p
instance Show (RepoType p)
instance Show (Repository p)
instance Show Pristine
module Darcs.Repository.Pristine
data Pristine
flagsToPristine :: [DarcsFlag] -> RepoFormat -> Pristine
nopristine :: Pristine
createPristine :: Pristine -> IO Pristine
removePristine :: Pristine -> IO ()
identifyPristine :: IO (Pristine)
applyPristine :: (Patchy p) => Pristine -> p -> IO ()
createPristineFromWorking :: Pristine -> IO ()
getPristinePop :: PatchInfo -> Pristine -> IO (Maybe Population)
pristineDirectory :: Pristine -> Maybe String
pristineToFlagString :: Pristine -> String
easyCreatePristineDirectoryTree :: Pristine -> FilePath -> IO Bool
easyCreatePartialsPristineDirectoryTree :: (FilePathLike fp) => [fp] -> Pristine -> FilePath -> IO Bool
module Darcs.Repository.DarcsRepo
writeInventory :: (RepoPatch p) => FilePath -> PatchSet p -> IO ()
writeInventoryAndPatches :: (RepoPatch p) => [DarcsFlag] -> PatchSet p -> IO ()
addToInventory :: FilePath -> [PatchInfo] -> IO ()
addToTentativePristine :: (Effect p) => p -> IO ()
addToTentativeInventory :: (RepoPatch p) => [DarcsFlag] -> Named p -> IO FilePath
removeFromTentativeInventory :: (RepoPatch p) => Bool -> [DarcsFlag] -> FL (PatchInfoAnd p) -> IO ()
finalizeTentativeChanges :: IO ()
finalizePristineChanges :: IO ()
revertTentativeChanges :: IO ()
readRepo :: (RepoPatch p) => [DarcsFlag] -> String -> IO (SealedPatchSet p)
readTentativeRepo :: (RepoPatch p) => [DarcsFlag] -> String -> IO (SealedPatchSet p)
writeAndReadPatch :: (RepoPatch p) => [DarcsFlag] -> PatchInfoAnd p -> IO (PatchInfoAnd p)
copyPatches :: [DarcsFlag] -> FilePath -> FilePath -> [PatchInfo] -> IO ()
readCheckpoints :: String -> IO [PatchInfo]
module Darcs.Repository.LowLevel
readPending :: (RepoPatch p) => Repository p -> IO (Sealed (FL Prim))
readPendingfile :: String -> IO (Sealed (FL Prim))
pendingName :: RepoType p -> String
readPrims :: ByteString -> Sealed (FL Prim)
module Darcs.Repository.State
-- | From a repository and a list of SubPath's, construct a filter that can
-- be used on a Tree (recorded or unrecorded state) of this repository.
-- This constructed filter will take pending into account, so the
-- subpaths will be translated correctly relative to pending move
-- patches. As an exception for convenience, if the subpath list is
-- empty, the filter constructed is an identity.
restrictSubpaths :: (RepoPatch p) => Repository p -> [SubPath] -> IO (TreeFilter m)
-- | Construct a Tree filter that removes any boring files the Tree might
-- have contained. Additionally, you should (in most cases) pass an
-- (expanded) Tree that corresponds to the recorded content of the
-- repository. This is important in the cases when the repository
-- contains files that would be boring otherwise. (If you pass emptyTree
-- instead, such files will simply be discarded by the filter, which is
-- usually not what you want.)
--
-- This function is most useful when you have a plain Tree corresponding
-- to the full working copy of the repository, including untracked files.
-- Cf. whatsnew, record --look-for-adds. NB. Assumes that our CWD is the
-- repository root.
restrictBoring :: Tree m -> IO (TreeFilter m)
newtype TreeFilter m
TreeFilter :: (forall tr. (FilterTree tr m) => tr m -> tr m) -> TreeFilter m
applyTreeFilter :: TreeFilter m -> forall tr. (FilterTree tr m) => tr m -> tr m
-- | For a repository and a list of paths (when empty, take everything)
-- compute a (forward) list of prims (i.e. a patch) going from the
-- recorded state of the repository (pristine) to the unrecorded state of
-- the repository (the working copy + pending). When a non-empty list of
-- paths is given, at least the files that live under any of these paths
-- in either recorded or unrecorded will be included in the resulting
-- patch. NB. More patches may be included in this list, eg. the full
-- contents of the pending patch. This is usually not a problem, since
-- selectChanges will properly filter the results anyway.
--
-- This also depends on the options given: with LookForAdds, we will
-- include any non-boring files (i.e. also those that do not exist in the
-- recorded state) in the working in the unrecorded state,
-- and therefore they will show up in the patches as addfiles.
--
-- The IgnoreTimes option disables index usage completely -- for each
-- file, we read both the unrecorded and the recorded copy and run a diff
-- on them. This is very inefficient, although in extremely rare cases,
-- the index could go out of sync (file is modified, index is updated and
-- file is modified again within a single second).
unrecordedChanges :: (RepoPatch p) => [DarcsFlag] -> Repository p -> [SubPath] -> IO (FL Prim)
readPending :: (RepoPatch p) => Repository p -> IO (Tree IO, Sealed (FL Prim))
-- | Obtains a Tree corresponding to the recorded state of the
-- repository: this is the same as the pristine cache, which is the same
-- as the result of applying all the repository's patches to an empty
-- directory.
--
-- Handles the plain and hashed pristine cases. Currently does not handle
-- the no-pristine case, as that requires replaying patches. Cf.
-- readDarcsHashed and readPlainTree in hashed-storage that
-- are used to do the actual Tree construction.
readRecorded :: (RepoPatch p) => Repository p -> IO (Tree IO)
-- | Obtains a Tree corresponding to the unrecorded state of the
-- repository: the working tree plus the pending patch. The
-- optional list of paths (it is ignored if empty) allows to restrict the
-- query to a subtree.
--
-- Limiting the query may be more efficient, since hashes on the
-- uninteresting parts of the index do not need to go through an
-- up-to-date check (which involves a relatively expensive lstat(2) per
-- file.
readUnrecorded :: (RepoPatch p) => Repository p -> [SubPath] -> IO (Tree IO)
readRecordedAndPending :: (RepoPatch p) => Repository p -> IO (Tree IO)
-- | Obtains a Tree corresponding to the working copy of the repository.
-- NB. Almost always, using readUnrecorded is the right choice. This
-- function is only useful in not-completely-constructed repositories.
readWorking :: IO (Tree IO)
readIndex :: (RepoPatch p) => Repository p -> IO Index
-- | Mark the existing index as invalid. This has to be called whenever the
-- listing of pristine changes and will cause darcs to update the index
-- next time it tries to read it. (NB. This is about files added and
-- removed from pristine: changes to file content in either pristine or
-- working are handled transparently by the index reading code.)
invalidateIndex :: t -> IO ()
module Darcs.Repository.HashedIO
type HashedIO r p = StateT (HashDir r p) IO
copyHashed :: String -> Cache -> Compression -> String -> IO ()
copyPartialsHashed :: (FilePathLike fp) => Cache -> Compression -> String -> [fp] -> IO ()
cleanHashdir :: Cache -> HashedDir -> [String] -> IO ()
instance Eq ObjType
instance WriteableDirectory (HashedIO RW p)
instance ReadableDirectory (HashedIO r p)
module Darcs.Repository.HashedRepo
revertTentativeChanges :: IO ()
finalizeTentativeChanges :: (RepoPatch p) => Repository p -> Compression -> IO ()
cleanPristine :: Repository p -> IO ()
copyPristine :: Cache -> Compression -> String -> String -> IO ()
copyPartialsPristine :: (FilePathLike fp) => Cache -> Compression -> String -> String -> [fp] -> IO ()
applyToTentativePristine :: (Patchy q) => [DarcsFlag] -> q -> IO ()
addToTentativeInventory :: (RepoPatch p) => Cache -> Compression -> PatchInfoAnd p -> IO FilePath
removeFromTentativeInventory :: (RepoPatch p) => Repository p -> Compression -> FL (PatchInfoAnd p) -> IO ()
readRepo :: (RepoPatch p) => Repository p -> String -> IO (PatchSet p)
readTentativeRepo :: (RepoPatch p) => Repository p -> String -> IO (PatchSet p)
writeAndReadPatch :: (RepoPatch p) => Cache -> Compression -> PatchInfoAnd p -> IO (PatchInfoAnd p)
writeTentativeInventory :: (RepoPatch p) => Cache -> Compression -> PatchSet p -> IO ()
copyRepo :: (RepoPatch p) => Repository p -> [DarcsFlag] -> String -> IO ()
readHashedPristineRoot :: Repository p -> IO (Maybe String)
pris2inv :: String -> ByteString -> Doc
copySources :: (RepoPatch p) => Repository p -> String -> IO ()
module Darcs.Repository.Internal
data Repository p
Repo :: !String -> ![DarcsFlag] -> !RepoFormat -> !RepoType p -> Repository
data RepoType p
DarcsRepository :: !Pristine -> Cache -> RepoType
-- | Repository IO monad. This monad-like datatype is responsible for
-- sequencing IO actions that modify the tentative recorded state of the
-- repository.
data RIO p a
($-) :: ((forall p. (RepoPatch p) => Repository p -> IO a) -> IO a) -> (forall p. (RepoPatch p) => Repository p -> IO a) -> IO a
maybeIdentifyRepository :: [DarcsFlag] -> String -> IO (IdentifyRepo p)
identifyDarcs1Repository :: [DarcsFlag] -> String -> IO (Repository Patch)
identifyRepositoryFor :: (RepoPatch p) => Repository p -> String -> IO (Repository p)
-- | The status of a given directory: is it a darcs repository?
data IdentifyRepo p
-- | looks like a repository with some error
BadRepository :: String -> IdentifyRepo p
-- | safest guess
NonRepository :: String -> IdentifyRepo p
GoodRepository :: (Repository p) -> IdentifyRepo p
findRepository :: [DarcsFlag] -> IO (Either String ())
amInRepository :: [DarcsFlag] -> IO (Either String ())
amNotInRepository :: [DarcsFlag] -> IO (Either String ())
revertRepositoryChanges :: (RepoPatch p) => Repository p -> IO ()
announceMergeConflicts :: String -> [DarcsFlag] -> FL Prim -> IO Bool
-- | setTentativePending is basically unsafe. It overwrites the pending
-- state with a new one, not related to the repository state.
setTentativePending :: (RepoPatch p) => Repository p -> FL Prim -> IO ()
checkUnrecordedConflicts :: (RepoPatch p) => [DarcsFlag] -> FL (Named p) -> IO Bool
withRecorded :: (RepoPatch p) => Repository p -> ((AbsolutePath -> IO a) -> IO a) -> (AbsolutePath -> IO a) -> IO a
readRepo :: (RepoPatch p) => Repository p -> IO (PatchSet p)
readTentativeRepo :: (RepoPatch p) => Repository p -> IO (PatchSet p)
prefsUrl :: Repository p -> String
makePatchLazy :: (RepoPatch p) => Repository p -> PatchInfoAnd p -> IO (PatchInfoAnd p)
withRepoLock :: [DarcsFlag] -> (forall p. (RepoPatch p) => Repository p -> IO a) -> IO a
withRepoReadLock :: [DarcsFlag] -> (forall p. (RepoPatch p) => Repository p -> IO a) -> IO a
withRepository :: [DarcsFlag] -> (forall p. (RepoPatch p) => Repository p -> IO a) -> IO a
withRepositoryDirectory :: [DarcsFlag] -> String -> (forall p. (RepoPatch p) => Repository p -> IO a) -> IO a
withGutsOf :: Repository p -> IO () -> IO ()
tentativelyAddPatch :: (RepoPatch p) => Repository p -> [DarcsFlag] -> PatchInfoAnd p -> IO (Repository p)
tentativelyRemovePatches :: (RepoPatch p) => Repository p -> [DarcsFlag] -> FL (PatchInfoAnd p) -> IO (Repository p)
-- | This fuction is unsafe because it accepts a patch that works on the
-- tentative pending and we don't currently track the state of the
-- tentative pending.
tentativelyAddToPending :: (RepoPatch p) => Repository p -> [DarcsFlag] -> FL Prim -> IO ()
tentativelyAddPatch_ :: (RepoPatch p) => UpdatePristine -> Repository p -> [DarcsFlag] -> PatchInfoAnd p -> IO (Repository p)
tentativelyReplacePatches :: (RepoPatch p) => Repository p -> [DarcsFlag] -> FL (PatchInfoAnd p) -> IO (Repository p)
finalizeRepositoryChanges :: (RepoPatch p) => Repository p -> IO ()
unrevertUrl :: Repository p -> String
applyToWorking :: (Patchy p) => Repository p1 -> [DarcsFlag] -> p -> IO (Repository p1)
patchSetToPatches :: (RepoPatch p) => PatchSet p -> FL (Named p)
createPristineDirectoryTree :: (RepoPatch p) => Repository p -> FilePath -> IO ()
createPartialsPristineDirectoryTree :: (FilePathLike fp, RepoPatch p) => Repository p -> [fp] -> FilePath -> IO ()
-- | Writes out a fresh copy of the inventory that minimizes the amount of
-- inventory that need be downloaded when people pull from the
-- repository.
--
-- Specifically, it breaks up the inventory on the most recent tag. This
-- speeds up most commands when run remotely, both because a smaller file
-- needs to be transfered (only the most recent inventory). It also gives
-- a guarantee that all the patches prior to a given tag are included in
-- that tag, so less commutation and history traversal is needed. This
-- latter issue can become very important in large repositories.
optimizeInventory :: (RepoPatch p) => Repository p -> IO ()
cleanRepository :: (RepoPatch p) => Repository p -> IO ()
getMarkedupFile :: (RepoPatch p) => Repository p -> PatchInfo -> FilePath -> IO MarkedUpFile
data PatchSet p
type SealedPatchSet p = Sealed ((PatchSet p))
-- | Sets scripts in or below the current directory executable. A script is
-- any file that starts with the bytes '#!'. This is used sometimes for
-- --set-scripts-executable, but at other times --set-scripts-executable
-- is handled by the hunk patch case of applyFL.
setScriptsExecutable :: IO ()
-- | Similar to the ask function of the MonadReader class. This
-- allows actions in the RIO monad to get the current repository. FIXME:
-- Don't export this. If we don't export this it makes it harder for
-- arbitrary IO actions to access the repository and hence our code is
-- easier to audit.
getRepository :: RIO p (Repository p)
-- | This the RIO equivalent of liftIO.
rIO :: IO a -> RIO p a
testTentative :: (RepoPatch p) => Repository p -> IO ()
testRecorded :: (RepoPatch p) => Repository p -> IO ()
data UpdatePristine
UpdatePristine :: UpdatePristine
DontUpdatePristine :: UpdatePristine
data MakeChanges
MakeChanges :: MakeChanges
DontMakeChanges :: MakeChanges
applyToTentativePristine :: (Effect q, Patchy q) => Repository p -> q -> IO ()
makeNewPending :: (RepoPatch p) => Repository p -> FL Prim -> IO ()
instance Eq UpdatePristine
instance Eq MakeChanges
instance Monad (RIO p)
instance Functor (RIO p)
module Darcs.Repository.Checkpoint
getCheckpoint :: (RepoPatch p) => Repository p -> IO (Maybe (Sealed (Named p)))
getCheckpointByDefault :: (RepoPatch p) => Repository p -> IO (Maybe (Sealed (Named p)))
identifyCheckpoint :: (RepoPatch p) => Repository p -> IO (Maybe PatchInfo)
writeCheckpointPatch :: (RepoPatch p) => Named p -> IO ()
module Darcs.Repository.Merge
tentativelyMergePatches_ :: (RepoPatch p) => MakeChanges -> Repository p -> String -> [DarcsFlag] -> FL (PatchInfoAnd p) -> FL (PatchInfoAnd p) -> IO (Sealed (FL Prim))
tentativelyMergePatches :: (RepoPatch p) => Repository p -> String -> [DarcsFlag] -> FL (PatchInfoAnd p) -> FL (PatchInfoAnd p) -> IO (Sealed (FL Prim))
considerMergeToWorking :: (RepoPatch p) => Repository p -> String -> [DarcsFlag] -> FL (PatchInfoAnd p) -> FL (PatchInfoAnd p) -> IO (Sealed (FL Prim))
module Darcs.Repository
data Repository p
data HashedDir
HashedPristineDir :: HashedDir
HashedPatchesDir :: HashedDir
HashedInventoriesDir :: HashedDir
newtype Cache
Ca :: [CacheLoc] -> Cache
data CacheLoc
Cache :: !CacheType -> !WritableOrNot -> !String -> CacheLoc
data WritableOrNot
Writable :: WritableOrNot
NotWritable :: WritableOrNot
($-) :: ((forall p. (RepoPatch p) => Repository p -> IO a) -> IO a) -> (forall p. (RepoPatch p) => Repository p -> IO a) -> IO a
maybeIdentifyRepository :: [DarcsFlag] -> String -> IO (IdentifyRepo p)
identifyRepositoryFor :: (RepoPatch p) => Repository p -> String -> IO (Repository p)
withRepoLock :: [DarcsFlag] -> (forall p. (RepoPatch p) => Repository p -> IO a) -> IO a
withRepoReadLock :: [DarcsFlag] -> (forall p. (RepoPatch p) => Repository p -> IO a) -> IO a
withRepository :: [DarcsFlag] -> (forall p. (RepoPatch p) => Repository p -> IO a) -> IO a
withRepositoryDirectory :: [DarcsFlag] -> String -> (forall p. (RepoPatch p) => Repository p -> IO a) -> IO a
withGutsOf :: Repository p -> IO () -> IO ()
makePatchLazy :: (RepoPatch p) => Repository p -> PatchInfoAnd p -> IO (PatchInfoAnd p)
-- | writePatchSet is like patchSetToRepository, except that it doesn't
-- touch the working directory or pristine cache.
writePatchSet :: (RepoPatch p) => PatchSet p -> [DarcsFlag] -> IO (Repository p)
findRepository :: [DarcsFlag] -> IO (Either String ())
amInRepository :: [DarcsFlag] -> IO (Either String ())
amNotInRepository :: [DarcsFlag] -> IO (Either String ())
-- | Replace the existing pristine with a new one (loaded up in a Tree
-- object).
replacePristine :: Repository p -> Tree IO -> IO ()
withRecorded :: (RepoPatch p) => Repository p -> ((AbsolutePath -> IO a) -> IO a) -> (AbsolutePath -> IO a) -> IO a
readRepo :: (RepoPatch p) => Repository p -> IO (PatchSet p)
prefsUrl :: Repository p -> String
addToPending :: (RepoPatch p) => Repository p -> FL Prim -> IO ()
tentativelyAddPatch :: (RepoPatch p) => Repository p -> [DarcsFlag] -> PatchInfoAnd p -> IO (Repository p)
tentativelyRemovePatches :: (RepoPatch p) => Repository p -> [DarcsFlag] -> FL (PatchInfoAnd p) -> IO (Repository p)
-- | This fuction is unsafe because it accepts a patch that works on the
-- tentative pending and we don't currently track the state of the
-- tentative pending.
tentativelyAddToPending :: (RepoPatch p) => Repository p -> [DarcsFlag] -> FL Prim -> IO ()
tentativelyReplacePatches :: (RepoPatch p) => Repository p -> [DarcsFlag] -> FL (PatchInfoAnd p) -> IO (Repository p)
readTentativeRepo :: (RepoPatch p) => Repository p -> IO (PatchSet p)
tentativelyMergePatches :: (RepoPatch p) => Repository p -> String -> [DarcsFlag] -> FL (PatchInfoAnd p) -> FL (PatchInfoAnd p) -> IO (Sealed (FL Prim))
considerMergeToWorking :: (RepoPatch p) => Repository p -> String -> [DarcsFlag] -> FL (PatchInfoAnd p) -> FL (PatchInfoAnd p) -> IO (Sealed (FL Prim))
revertRepositoryChanges :: (RepoPatch p) => Repository p -> IO ()
finalizeRepositoryChanges :: (RepoPatch p) => Repository p -> IO ()
createRepository :: [DarcsFlag] -> IO ()
copyRepository :: (RepoPatch p) => Repository p -> IO ()
copyOldrepoPatches :: (RepoPatch p) => [DarcsFlag] -> Repository p -> FilePath -> IO ()
-- | patchSetToRepository takes a patch set, and writes a new repository in
-- the current directory that contains all the patches in the patch set.
-- This function is used when 'darcs get'ing a repository with the
-- --to-match flag and the new repository is not in hashed format. This
-- function does not (yet) work for hashed repositories. If the passed
-- DarcsFlags tell darcs to create a hashed repository, this
-- function will call error.
patchSetToRepository :: (RepoPatch p) => Repository p -> PatchSet p -> [DarcsFlag] -> IO (Repository p)
unrevertUrl :: Repository p -> String
applyToWorking :: (Patchy p) => Repository p1 -> [DarcsFlag] -> p -> IO (Repository p1)
patchSetToPatches :: (RepoPatch p) => PatchSet p -> FL (Named p)
createPristineDirectoryTree :: (RepoPatch p) => Repository p -> FilePath -> IO ()
createPartialsPristineDirectoryTree :: (FilePathLike fp, RepoPatch p) => Repository p -> [fp] -> FilePath -> IO ()
-- | Writes out a fresh copy of the inventory that minimizes the amount of
-- inventory that need be downloaded when people pull from the
-- repository.
--
-- Specifically, it breaks up the inventory on the most recent tag. This
-- speeds up most commands when run remotely, both because a smaller file
-- needs to be transfered (only the most recent inventory). It also gives
-- a guarantee that all the patches prior to a given tag are included in
-- that tag, so less commutation and history traversal is needed. This
-- latter issue can become very important in large repositories.
optimizeInventory :: (RepoPatch p) => Repository p -> IO ()
cleanRepository :: (RepoPatch p) => Repository p -> IO ()
getMarkedupFile :: (RepoPatch p) => Repository p -> PatchInfo -> FilePath -> IO MarkedUpFile
data PatchSet p
type SealedPatchSet p = Sealed ((PatchSet p))
-- | PatchInfoAnd p represents a hope we have to get a
-- patch through its info. We're not sure we have the patch, but we know
-- its info.
data PatchInfoAnd p
-- | Sets scripts in or below the current directory executable. A script is
-- any file that starts with the bytes '#!'. This is used sometimes for
-- --set-scripts-executable, but at other times --set-scripts-executable
-- is handled by the hunk patch case of applyFL.
setScriptsExecutable :: IO ()
checkUnrelatedRepos :: (RepoPatch p) => [DarcsFlag] -> PatchSet p -> PatchSet p -> IO ()
testTentative :: (RepoPatch p) => Repository p -> IO ()
testRecorded :: (RepoPatch p) => Repository p -> IO ()
extractOptions :: Repository p -> [DarcsFlag]
-- | modifyCache repository function modifies the cache of
-- repository with function, remove duplicates and sort
-- the results with compareByLocality.
modifyCache :: (RepoPatch p) => Repository p -> (Cache -> Cache) -> Repository p
-- | Obtains a Tree corresponding to the recorded state of the
-- repository: this is the same as the pristine cache, which is the same
-- as the result of applying all the repository's patches to an empty
-- directory.
--
-- Handles the plain and hashed pristine cases. Currently does not handle
-- the no-pristine case, as that requires replaying patches. Cf.
-- readDarcsHashed and readPlainTree in hashed-storage that
-- are used to do the actual Tree construction.
readRecorded :: (RepoPatch p) => Repository p -> IO (Tree IO)
-- | Obtains a Tree corresponding to the unrecorded state of the
-- repository: the working tree plus the pending patch. The
-- optional list of paths (it is ignored if empty) allows to restrict the
-- query to a subtree.
--
-- Limiting the query may be more efficient, since hashes on the
-- uninteresting parts of the index do not need to go through an
-- up-to-date check (which involves a relatively expensive lstat(2) per
-- file.
readUnrecorded :: (RepoPatch p) => Repository p -> [SubPath] -> IO (Tree IO)
-- | For a repository and a list of paths (when empty, take everything)
-- compute a (forward) list of prims (i.e. a patch) going from the
-- recorded state of the repository (pristine) to the unrecorded state of
-- the repository (the working copy + pending). When a non-empty list of
-- paths is given, at least the files that live under any of these paths
-- in either recorded or unrecorded will be included in the resulting
-- patch. NB. More patches may be included in this list, eg. the full
-- contents of the pending patch. This is usually not a problem, since
-- selectChanges will properly filter the results anyway.
--
-- This also depends on the options given: with LookForAdds, we will
-- include any non-boring files (i.e. also those that do not exist in the
-- recorded state) in the working in the unrecorded state,
-- and therefore they will show up in the patches as addfiles.
--
-- The IgnoreTimes option disables index usage completely -- for each
-- file, we read both the unrecorded and the recorded copy and run a diff
-- on them. This is very inefficient, although in extremely rare cases,
-- the index could go out of sync (file is modified, index is updated and
-- file is modified again within a single second).
unrecordedChanges :: (RepoPatch p) => [DarcsFlag] -> Repository p -> [SubPath] -> IO (FL Prim)
readPending :: (RepoPatch p) => Repository p -> IO (Tree IO, Sealed (FL Prim))
readRecordedAndPending :: (RepoPatch p) => Repository p -> IO (Tree IO)
readIndex :: (RepoPatch p) => Repository p -> IO Index
-- | Mark the existing index as invalid. This has to be called whenever the
-- listing of pristine changes and will cause darcs to update the index
-- next time it tries to read it. (NB. This is about files added and
-- removed from pristine: changes to file content in either pristine or
-- working are handled transparently by the index reading code.)
invalidateIndex :: t -> IO ()
instance Eq PorNP
module Darcs.Arguments
-- | The DarcsFlag type is a list of all flags that can ever be
-- passed to darcs, or to one of its commands.
data DarcsFlag
Help :: DarcsFlag
ListOptions :: DarcsFlag
NoTest :: DarcsFlag
Test :: DarcsFlag
OnlyChangesToFiles :: DarcsFlag
ChangesToAllFiles :: DarcsFlag
LeaveTestDir :: DarcsFlag
NoLeaveTestDir :: DarcsFlag
Timings :: DarcsFlag
Debug :: DarcsFlag
DebugVerbose :: DarcsFlag
DebugHTTP :: DarcsFlag
Verbose :: DarcsFlag
NormalVerbosity :: DarcsFlag
Quiet :: DarcsFlag
Target :: String -> DarcsFlag
Cc :: String -> DarcsFlag
Output :: AbsolutePathOrStd -> DarcsFlag
OutputAutoName :: AbsolutePath -> DarcsFlag
Subject :: String -> DarcsFlag
InReplyTo :: String -> DarcsFlag
SendmailCmd :: String -> DarcsFlag
Author :: String -> DarcsFlag
PatchName :: String -> DarcsFlag
OnePatch :: String -> DarcsFlag
SeveralPatch :: String -> DarcsFlag
AfterPatch :: String -> DarcsFlag
UpToPatch :: String -> DarcsFlag
TagName :: String -> DarcsFlag
LastN :: Int -> DarcsFlag
MaxCount :: Int -> DarcsFlag
PatchIndexRange :: Int -> Int -> DarcsFlag
NumberPatches :: DarcsFlag
OneTag :: String -> DarcsFlag
AfterTag :: String -> DarcsFlag
UpToTag :: String -> DarcsFlag
Context :: AbsolutePath -> DarcsFlag
Count :: DarcsFlag
LogFile :: AbsolutePath -> DarcsFlag
RmLogFile :: DarcsFlag
DontRmLogFile :: DarcsFlag
DistName :: String -> DarcsFlag
All :: DarcsFlag
Recursive :: DarcsFlag
NoRecursive :: DarcsFlag
Reorder :: DarcsFlag
RestrictPaths :: DarcsFlag
DontRestrictPaths :: DarcsFlag
AskDeps :: DarcsFlag
NoAskDeps :: DarcsFlag
IgnoreTimes :: DarcsFlag
DontIgnoreTimes :: DarcsFlag
LookForAdds :: DarcsFlag
NoLookForAdds :: DarcsFlag
AnyOrder :: DarcsFlag
CreatorHash :: String -> DarcsFlag
Intersection :: DarcsFlag
Union :: DarcsFlag
Complement :: DarcsFlag
Sign :: DarcsFlag
SignAs :: String -> DarcsFlag
NoSign :: DarcsFlag
SignSSL :: String -> DarcsFlag
HappyForwarding :: DarcsFlag
NoHappyForwarding :: DarcsFlag
Verify :: AbsolutePath -> DarcsFlag
VerifySSL :: AbsolutePath -> DarcsFlag
SSHControlMaster :: DarcsFlag
NoSSHControlMaster :: DarcsFlag
RemoteDarcs :: String -> DarcsFlag
EditDescription :: DarcsFlag
NoEditDescription :: DarcsFlag
Toks :: String -> DarcsFlag
EditLongComment :: DarcsFlag
NoEditLongComment :: DarcsFlag
PromptLongComment :: DarcsFlag
KeepDate :: DarcsFlag
NoKeepDate :: DarcsFlag
AllowConflicts :: DarcsFlag
MarkConflicts :: DarcsFlag
NoAllowConflicts :: DarcsFlag
SkipConflicts :: DarcsFlag
Boring :: DarcsFlag
SkipBoring :: DarcsFlag
AllowCaseOnly :: DarcsFlag
DontAllowCaseOnly :: DarcsFlag
AllowWindowsReserved :: DarcsFlag
DontAllowWindowsReserved :: DarcsFlag
DontGrabDeps :: DarcsFlag
DontPromptForDependencies :: DarcsFlag
PromptForDependencies :: DarcsFlag
Compress :: DarcsFlag
NoCompress :: DarcsFlag
UnCompress :: DarcsFlag
WorkRepoDir :: String -> DarcsFlag
WorkRepoUrl :: String -> DarcsFlag
RemoteRepo :: String -> DarcsFlag
NewRepo :: String -> DarcsFlag
Reply :: String -> DarcsFlag
ApplyAs :: String -> DarcsFlag
MachineReadable :: DarcsFlag
HumanReadable :: DarcsFlag
Pipe :: DarcsFlag
Interactive :: DarcsFlag
DiffCmd :: String -> DarcsFlag
ExternalMerge :: String -> DarcsFlag
Summary :: DarcsFlag
NoSummary :: DarcsFlag
Unified :: DarcsFlag
NonUnified :: DarcsFlag
Reverse :: DarcsFlag
Forward :: DarcsFlag
Partial :: DarcsFlag
Complete :: DarcsFlag
Lazy :: DarcsFlag
Ephemeral :: DarcsFlag
FixFilePath :: AbsolutePath -> AbsolutePath -> DarcsFlag
DiffFlags :: String -> DarcsFlag
XMLOutput :: DarcsFlag
ForceReplace :: DarcsFlag
OnePattern :: PatchMatch -> DarcsFlag
SeveralPattern :: PatchMatch -> DarcsFlag
AfterPattern :: PatchMatch -> DarcsFlag
UpToPattern :: PatchMatch -> DarcsFlag
NonApply :: DarcsFlag
NonVerify :: DarcsFlag
NonForce :: DarcsFlag
DryRun :: DarcsFlag
SetDefault :: DarcsFlag
NoSetDefault :: DarcsFlag
FancyMoveAdd :: DarcsFlag
NoFancyMoveAdd :: DarcsFlag
Disable :: DarcsFlag
SetScriptsExecutable :: DarcsFlag
DontSetScriptsExecutable :: DarcsFlag
Bisect :: DarcsFlag
UseHashedInventory :: DarcsFlag
UseOldFashionedInventory :: DarcsFlag
UseFormat2 :: DarcsFlag
PristinePlain :: DarcsFlag
PristineNone :: DarcsFlag
NoUpdateWorking :: DarcsFlag
Sibling :: AbsolutePath -> DarcsFlag
Relink :: DarcsFlag
RelinkPristine :: DarcsFlag
NoLinks :: DarcsFlag
OptimizePristine :: DarcsFlag
OptimizeHTTP :: DarcsFlag
UpgradeFormat :: DarcsFlag
Files :: DarcsFlag
NoFiles :: DarcsFlag
Directories :: DarcsFlag
NoDirectories :: DarcsFlag
Pending :: DarcsFlag
NoPending :: DarcsFlag
PosthookCmd :: String -> DarcsFlag
NoPosthook :: DarcsFlag
AskPosthook :: DarcsFlag
RunPosthook :: DarcsFlag
PrehookCmd :: String -> DarcsFlag
NoPrehook :: DarcsFlag
AskPrehook :: DarcsFlag
RunPrehook :: DarcsFlag
UMask :: String -> DarcsFlag
StoreInMemory :: DarcsFlag
ApplyOnDisk :: DarcsFlag
NoHTTPPipelining :: DarcsFlag
NoCache :: DarcsFlag
AllowUnrelatedRepos :: DarcsFlag
Check :: DarcsFlag
Repair :: DarcsFlag
JustThisRepo :: DarcsFlag
NullFlag :: DarcsFlag
flagToString :: [DarcsOption] -> DarcsFlag -> Maybe String
applyDefaults :: [DarcsOption] -> [DarcsFlag] -> [DarcsFlag]
nubOptions :: [DarcsOption] -> [DarcsFlag] -> [DarcsFlag]
maxCount :: [DarcsFlag] -> Maybe Int
isin :: DarcsAtomicOption -> [DarcsFlag] -> Bool
arein :: DarcsOption -> [DarcsFlag] -> Bool
definePatches :: (RepoPatch p) => FL (PatchInfoAnd p) -> IO ()
defineChanges :: (Patchy p) => p -> IO ()
fixFilePathOrStd :: [DarcsFlag] -> FilePath -> IO AbsolutePathOrStd
fixUrl :: [DarcsFlag] -> String -> IO String
fixUrlFlag :: [DarcsFlag] -> DarcsFlag -> IO DarcsFlag
-- | fixSubPaths files returns the SubPaths 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.
fixSubPaths :: [DarcsFlag] -> [FilePath] -> IO [SubPath]
areFileArgs :: [SubPath] -> Bool
-- | A type for darcs' options. The value contains the command line
-- switch(es) for the option, a help string, and a function to build a
-- DarcsFlag from the command line arguments. for each
-- constructor, shortSwitches represents the list of short
-- command line switches which invoke the option, longSwitches the list
-- of long command line switches, optDescr the description of the option,
-- and argDescr the description of its argument, if any. mkFlag is a
-- function which makes a DarcsFlag from the arguments of the
-- option.
data DarcsAtomicOption
-- | DarcsArgOption shortSwitches longSwitches mkFlag ArgDescr
-- OptDescr The constructor for options with a string argument, such
-- as --tag
DarcsArgOption :: [Char] -> [String] -> (String -> DarcsFlag) -> String -> String -> DarcsAtomicOption
-- | DarcsAbsPathOption shortSwitches longSwitches mkFlag ArgDescr
-- OptDescr The constructor for options with an absolute path
-- argument, such as --sibling
DarcsAbsPathOption :: [Char] -> [String] -> (AbsolutePath -> DarcsFlag) -> String -> String -> DarcsAtomicOption
-- | DarcsAbsPathOrStdOption shortSwitches longSwitches mkFlag ArgDescr
-- OptDescr The constructor for options with a path argument, such
-- as -o
DarcsAbsPathOrStdOption :: [Char] -> [String] -> (AbsolutePathOrStd -> DarcsFlag) -> String -> String -> DarcsAtomicOption
-- | DarcsOptAbsPathOrStdOption shortSwitches longSwitches defaultPath
-- mkFlag ArgDescr OptDescr where defaultPath is a default value for
-- the Path, as a string to be parsed as if it had been given on the
-- command line. The constructor for options with an optional path
-- argument, such as -O
DarcsOptAbsPathOption :: [Char] -> [String] -> String -> (AbsolutePath -> DarcsFlag) -> String -> String -> DarcsAtomicOption
-- | DarcsNoArgOption shortSwitches longSwitches mkFlag optDescr
-- The constructon fon options with no arguments.
DarcsNoArgOption :: [Char] -> [String] -> DarcsFlag -> String -> DarcsAtomicOption
atomicOptions :: DarcsOption -> [DarcsAtomicOption]
data DarcsOption
DarcsSingleOption :: DarcsAtomicOption -> DarcsOption
-- | A constructor for grouping related options together, such as
-- --hashed, --darcs-2 and
-- --old-fashioned-inventory.
DarcsMultipleChoiceOption :: [DarcsAtomicOption] -> DarcsOption
DarcsMutuallyExclusive :: [DarcsAtomicOption] -> ([DarcsFlag] -> [DarcsFlag]) -> DarcsOption
optionFromDarcsOption :: AbsolutePath -> DarcsOption -> [OptDescr DarcsFlag]
help :: DarcsOption
-- | list_option is an option which lists the command's arguments
listOptions :: DarcsOption
-- | Get a list of all non-boring files and directories in the working
-- copy.
listFiles :: IO [String]
anyVerbosity :: [DarcsOption]
disable :: DarcsOption
restrictPaths :: DarcsOption
notest :: DarcsOption
test :: DarcsOption
workingRepoDir :: DarcsOption
-- | remoteRepo is the option used to specify the URL of the remote
-- repository to work with
remoteRepo :: DarcsOption
leaveTestDir :: DarcsOption
possiblyRemoteRepoDir :: DarcsOption
-- | 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
getRepourl :: [DarcsFlag] -> Maybe String
-- | listRegisteredFiles returns the list of all registered files in
-- the repository.
listRegisteredFiles :: IO [String]
-- | listUnregisteredFiles returns the list of all non-boring
-- unregistered files in the repository.
listUnregisteredFiles :: IO [String]
author :: DarcsOption
-- | 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 _darcs/prefs, and if it's not
-- possible, ask the user.
getAuthor :: [DarcsFlag] -> IO String
-- | getEasyAuthor tries to get the author name first from the
-- repository preferences, then from global preferences, then from
-- environment variables. Returns Nothing if it could not get it.
getEasyAuthor :: IO (Maybe 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
-- $SENDMAIL which will be used as a fallback if
-- present.
getSendmailCmd :: [DarcsFlag] -> IO String
fileHelpAuthor :: [String]
environmentHelpEmail :: ([String], [String])
patchnameOption :: DarcsOption
distnameOption :: DarcsOption
logfile :: DarcsOption
rmlogfile :: DarcsOption
fromOpt :: DarcsOption
subject :: DarcsOption
-- | 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
getSubject :: [DarcsFlag] -> Maybe String
inReplyTo :: DarcsOption
getInReplyTo :: [DarcsFlag] -> Maybe String
target :: DarcsOption
ccSend :: DarcsOption
ccApply :: DarcsOption
-- | 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.
getCc :: [DarcsFlag] -> String
output :: DarcsOption
outputAutoName :: DarcsOption
recursive :: String -> DarcsOption
inventoryChoices :: DarcsOption
getInventoryChoices :: DarcsOption
upgradeFormat :: DarcsOption
askdeps :: DarcsOption
ignoretimes :: DarcsOption
lookforadds :: DarcsOption
askLongComment :: DarcsOption
keepDate :: DarcsOption
sendmailCmd :: DarcsOption
environmentHelpSendmail :: ([String], [String])
sign :: DarcsOption
verify :: DarcsOption
editDescription :: DarcsOption
reponame :: DarcsOption
creatorhash :: DarcsOption
applyConflictOptions :: DarcsOption
reply :: DarcsOption
pullConflictOptions :: DarcsOption
useExternalMerge :: DarcsOption
depsSel :: DarcsOption
nocompress :: DarcsOption
uncompressNocompress :: DarcsOption
repoCombinator :: DarcsOption
optionsLatex :: [DarcsOption] -> String
reorderPatches :: DarcsOption
noskipBoring :: DarcsOption
allowProblematicFilenames :: DarcsOption
applyas :: DarcsOption
humanReadable :: DarcsOption
changesReverse :: DarcsOption
onlyToFiles :: DarcsOption
changesFormat :: DarcsOption
matchOneContext :: DarcsOption
matchOneNontag :: DarcsOption
matchMaxcount :: DarcsOption
sendToContext :: DarcsOption
-- | getContext takes a list of flags and returns the context
-- specified by Context c in that list of flags, if any. This
-- flag is present if darcs was invoked with --context=FILE
getContext :: [DarcsFlag] -> Maybe AbsolutePath
pipeInteractive :: DarcsOption
allInteractive :: DarcsOption
allPipeInteractive :: DarcsOption
summary :: DarcsOption
unified :: DarcsOption
tokens :: DarcsOption
partial :: DarcsOption
partialCheck :: DarcsOption
diffCmdFlag :: DarcsOption
diffflags :: DarcsOption
unidiff :: DarcsOption
xmloutput :: DarcsOption
forceReplace :: DarcsOption
dryRun :: [DarcsOption]
dryRunNoxml :: DarcsOption
-- | printDryRunMessageAndExit action opts patches prints a
-- string representing the action that would be taken if the
-- --dry-run option had not been passed to darcs. Then darcs
-- exits successfully. action is the name of the action being
-- taken, like "push" opts is the list of flags which
-- were sent to darcs patches is the sequence of patches which
-- would be touched by action.
printDryRunMessageAndExit :: (RepoPatch p) => String -> [DarcsFlag] -> FL (PatchInfoAnd p) -> IO ()
-- | showFriendly flags patch returns a Doc
-- representing the right way to show patch given the list
-- flags of flags darcs was invoked with.
showFriendly :: (Patchy p) => [DarcsFlag] -> p -> Doc
matchOne :: DarcsOption
matchSeveral :: DarcsOption
matchRange :: DarcsOption
matchSeveralOrRange :: DarcsOption
happyForwarding :: DarcsOption
matchSeveralOrLast :: DarcsOption
setDefault :: Bool -> DarcsOption
fancyMoveAdd :: DarcsOption
setScriptsExecutableOption :: DarcsOption
bisect :: DarcsOption
sibling :: DarcsOption
-- | flagsToSiblings collects the contents of all Sibling
-- flags in a list of flags.
flagsToSiblings :: [DarcsFlag] -> [AbsolutePath]
relink :: DarcsOption
relinkPristine :: DarcsOption
nolinks :: DarcsOption
files :: DarcsOption
directories :: DarcsOption
pending :: DarcsOption
posthookCmd :: DarcsOption
posthookPrompt :: DarcsOption
-- | getPosthookCmd takes a list of flags and returns the posthook
-- command specified by PosthookCmd a in that list of flags, if
-- any.
getPosthookCmd :: [DarcsFlag] -> Maybe String
prehookCmd :: DarcsOption
prehookPrompt :: DarcsOption
-- | getPrehookCmd takes a list of flags and returns the prehook
-- command specified by PrehookCmd a in that list of flags, if
-- any.
getPrehookCmd :: [DarcsFlag] -> Maybe String
nullFlag :: DarcsOption
umaskOption :: DarcsOption
storeInMemory :: DarcsOption
-- | patchSelectFlag f holds whenever f is a way
-- of selecting patches such as PatchName n.
patchSelectFlag :: DarcsFlag -> Bool
networkOptions :: [DarcsOption]
noCache :: DarcsOption
allowUnrelatedRepos :: DarcsOption
checkOrRepair :: DarcsOption
justThisRepo :: DarcsOption
optimizePristine :: DarcsOption
optimizeHTTP :: DarcsOption
getOutput :: [DarcsFlag] -> FilePath -> Maybe AbsolutePathOrStd
instance Eq FlagContent
instance Show FlagContent
instance Ord FlagContent
module Darcs.Commands
data CommandControl
CommandData :: DarcsCommand -> CommandControl
HiddenCommand :: DarcsCommand -> CommandControl
GroupName :: String -> CommandControl
data DarcsCommand
DarcsCommand :: String -> String -> String -> Int -> [String] -> ([DarcsFlag] -> [String] -> IO ()) -> ([DarcsFlag] -> IO (Either String ())) -> IO [String] -> ([DarcsFlag] -> AbsolutePath -> [String] -> IO [String]) -> [DarcsOption] -> [DarcsOption] -> DarcsCommand
commandName :: DarcsCommand -> String
commandHelp :: DarcsCommand -> String
commandDescription :: DarcsCommand -> String
commandExtraArgs :: DarcsCommand -> Int
commandExtraArgHelp :: DarcsCommand -> [String]
commandCommand :: DarcsCommand -> [DarcsFlag] -> [String] -> IO ()
commandPrereq :: DarcsCommand -> [DarcsFlag] -> IO (Either String ())
commandGetArgPossibilities :: DarcsCommand -> IO [String]
commandArgdefaults :: DarcsCommand -> [DarcsFlag] -> AbsolutePath -> [String] -> IO [String]
commandBasicOptions :: DarcsCommand -> [DarcsOption]
commandAdvancedOptions :: DarcsCommand -> [DarcsOption]
SuperCommand :: String -> String -> String -> ([DarcsFlag] -> IO (Either String ())) -> [CommandControl] -> DarcsCommand
commandName :: DarcsCommand -> String
commandHelp :: DarcsCommand -> String
commandDescription :: DarcsCommand -> String
commandPrereq :: DarcsCommand -> [DarcsFlag] -> IO (Either String ())
commandSubCommands :: DarcsCommand -> [CommandControl]
commandAlias :: String -> Maybe DarcsCommand -> DarcsCommand -> DarcsCommand
commandStub :: String -> String -> String -> DarcsCommand -> DarcsCommand
commandOptions :: AbsolutePath -> DarcsCommand -> ([OptDescr DarcsFlag], [OptDescr DarcsFlag])
commandAlloptions :: DarcsCommand -> ([DarcsOption], [DarcsOption])
disambiguateCommands :: [CommandControl] -> String -> [String] -> Either String (CommandArgs, [String])
data CommandArgs
CommandOnly :: DarcsCommand -> CommandArgs
SuperCommandOnly :: DarcsCommand -> CommandArgs
SuperCommandSub :: DarcsCommand -> DarcsCommand -> CommandArgs
getCommandHelp :: Maybe DarcsCommand -> DarcsCommand -> String
getCommandMiniHelp :: Maybe DarcsCommand -> DarcsCommand -> String
getSubcommands :: DarcsCommand -> [CommandControl]
usage :: [CommandControl] -> String
usageHelper :: [CommandControl] -> String
subusage :: DarcsCommand -> String
chompNewline :: String -> String
extractCommands :: [CommandControl] -> [DarcsCommand]
superName :: Maybe DarcsCommand -> String
nodefaults :: [DarcsFlag] -> AbsolutePath -> [String] -> IO [String]
putInfo :: [DarcsFlag] -> Doc -> IO ()
putVerbose :: [DarcsFlag] -> Doc -> IO ()
putWarning :: [DarcsFlag] -> Doc -> IO ()
abortRun :: [DarcsFlag] -> Doc -> IO ()
module Darcs.PrintPatch
-- | printPatch prints a patch on standard output.
printPatch :: (Patchy p) => p -> IO ()
-- | contextualPrintPatch prints a patch, together with its context,
-- on standard output.
contextualPrintPatch :: (Patchy p) => Tree IO -> p -> IO ()
-- | printPatchPager runs '$PAGER' and shows a patch in it.
printPatchPager :: (Patchy p) => p -> IO ()
-- | printFriendly opts patch prints patch in
-- accordance with the flags in opts, ie, whether --verbose or
-- --summary were passed at the command-line.
printFriendly :: (Patchy p) => [DarcsFlag] -> p -> IO ()
module Darcs.Test
getTest :: [DarcsFlag] -> IO (IO ExitCode)
runPosthook :: [DarcsFlag] -> AbsolutePath -> IO ExitCode
runPrehook :: [DarcsFlag] -> AbsolutePath -> IO ExitCode
module Darcs.Commands.Add
add :: DarcsCommand
expandDirs :: [SubPath] -> IO [SubPath]
module Darcs.Population
-- | the population of a darcs repository (simpler Slurpy)
data Population
patchChanges :: Prim -> [(String, DirMark)]
applyToPop :: PatchInfo -> FL Prim -> Population -> Population
-- | read the population from a given directory dirname all
-- folders and documents get the given time t
--
-- This needs to be here in order to avoid a circular dependency between
-- Population and Pristine.
getPopFrom :: FilePath -> PatchInfo -> IO Population
setPopState :: PatchInfo -> Population -> Population
-- | info of a directory member
data DirMark
AddedFile :: DirMark
RemovedFile :: DirMark
MovedFile :: String -> DirMark
ModifiedFile :: DirMark
DullFile :: DirMark
AddedDir :: DirMark
RemovedDir :: DirMark
MovedDir :: !String -> DirMark
DullDir :: DirMark
-- | get the pristine population from a repo
getRepoPop :: FilePath -> IO Population
getRepoPopVersion :: FilePath -> PatchInfo -> IO Population
modifiedToXml :: Info -> Doc
lookupPop :: FilePath -> Population -> Maybe Population
lookupCreationPop :: PatchInfo -> FilePath -> Population -> Maybe Population
module Darcs.Match
-- | matchFirstPatchset fs ps returns the part of ps
-- before its first matcher, ie the one that comes first dependencywise.
-- Hence, patches in matchFirstPatchset fs ps are the ones we
-- don't want.
--
-- Question: are they really? Florent
matchFirstPatchset :: (RepoPatch p) => [DarcsFlag] -> PatchSet p -> SealedPatchSet p
-- | matchSecondPatchset fs ps returns the part of ps
-- before its second matcher, ie the one that comes last dependencywise.
matchSecondPatchset :: (RepoPatch p) => [DarcsFlag] -> PatchSet p -> SealedPatchSet p
matchPatch :: (RepoPatch p) => [DarcsFlag] -> PatchSet p -> Sealed2 (Named p)
-- | matchAPatch fs p tells whether p matches the
-- matchers in the flags fs
matchAPatch :: (Patchy p) => [DarcsFlag] -> Named p -> Bool
-- | matchAPatchread fs p tells whether p matches the
-- matchers in the flags listed in fs.
matchAPatchread :: (Patchy p) => [DarcsFlag] -> PatchInfoAnd p -> Bool
getFirstMatch :: (RepoPatch p) => Repository p -> [DarcsFlag] -> IO ()
getNonrangeMatch :: (RepoPatch p) => Repository p -> [DarcsFlag] -> IO ()
getPartialFirstMatch :: (RepoPatch p) => Repository p -> [DarcsFlag] -> [FileName] -> IO ()
getPartialSecondMatch :: (RepoPatch p) => Repository p -> [DarcsFlag] -> [FileName] -> IO ()
getPartialNonrangeMatch :: (RepoPatch p) => Repository p -> [DarcsFlag] -> [FileName] -> IO ()
-- | firstMatch fs tells whether fs implies a first
-- match, that is if we match against patches from a point in the
-- past on, rather than against all patches since the creation of the
-- repository.
firstMatch :: [DarcsFlag] -> Bool
-- | secondMatch fs tells whether fs implies a second
-- match, that is if we match against patches up to a point in the
-- past on, rather than against all patches until now.
secondMatch :: [DarcsFlag] -> Bool
-- | haveNonrangeMatch flags tells whether there is a flag in
-- flags which corresponds to a match that is non-range.
-- Thus, --match, --patch and --index make
-- haveNonrangeMatch true, but not --from-patch or
-- --to-patch.
haveNonrangeMatch :: [DarcsFlag] -> Bool
-- | havePatchsetMatch flags tells whether there is a patchset
-- match in the flag list. A patchset match is --match or
-- --patch, or --context, but not --from-patch
-- nor (!) --index. Question: Is it supposed not to be a subset
-- of haveNonrangeMatch?
havePatchsetMatch :: [DarcsFlag] -> Bool
getOnePatchset :: (RepoPatch p) => Repository p -> [DarcsFlag] -> IO (SealedPatchSet p)
checkMatchSyntax :: [DarcsFlag] -> IO ()
applyInvToMatcher :: (RepoPatch p, WriteableDirectory m) => InclusiveOrExclusive -> Matcher p -> PatchSet p -> m ()
-- | nonrangeMatcher is the criterion that is used to match
-- against patches in the interval. It is 'Just m' when the
-- --patch, --match, --tag options are passed
-- (or their plural variants).
nonrangeMatcher :: (Patchy p) => [DarcsFlag] -> Maybe (Matcher p)
data InclusiveOrExclusive
Inclusive :: InclusiveOrExclusive
Exclusive :: InclusiveOrExclusive
-- | matchExists m ps tells whether there is a patch matching
-- m in ps
matchExists :: Matcher p -> PatchSet p -> Bool
instance Eq InclusiveOrExclusive
module Darcs.SelectChanges
-- | Select patches from a FL.
selectChanges :: (Patchy p) => WhichChanges -> FL p -> PatchSelection p
-- | When asking about patches, we either ask about them in oldest-first or
-- newest first (with respect to the current ordering of the repository),
-- and we either want an initial segment or a final segment of the poset
-- of patches.
--
-- First: ask for an initial segment, first patches first
-- (default for all pull-like commands)
--
-- FirstReversed: ask for an initial segment, last patches first
-- (used to ask about dependencies in record, and for pull-like commands
-- with the --reverse flag).
--
-- LastReversed: ask for a final segment, last patches first.
-- (default for unpull-like commands, except for selecting *primitive*
-- patches in rollback)
--
-- Last: ask for a final segment, first patches first. (used for
-- selecting primitive patches in rollback, and for unpull-like commands
-- with the --reverse flag
data WhichChanges
Last :: WhichChanges
LastReversed :: WhichChanges
First :: WhichChanges
FirstReversed :: WhichChanges
-- | The equivalent of selectChanges for the darcs changes
-- command
viewChanges :: (Patchy p) => [DarcsFlag] -> [Sealed2 p] -> IO ()
-- | The function for selecting a patch to amend record. Read at your own
-- risks.
withSelectedPatchFromRepo :: (RepoPatch p) => String -> Repository p -> [DarcsFlag] -> ((FL (PatchInfoAnd p) :> PatchInfoAnd p) -> IO ()) -> IO ()
-- | Optionally remove any patches (+dependencies) from a sequence that
-- conflict with the recorded or unrecorded changes in a repo
filterOutConflicts :: (RepoPatch p) => [DarcsFlag] -> RL (PatchInfoAnd p) -> Repository p -> FL (PatchInfoAnd p) -> IO (Bool, Sealed (FL (PatchInfoAnd p)))
-- | runs a PatchSelection action in the given
-- PatchSelectionContext.
runSelection :: (Patchy p) => PatchSelection p -> PatchSelectionContext p -> IO ((FL p :> FL p))
-- | A PatchSelectionContext for selecting Prim patches.
selectionContextPrim :: String -> [DarcsFlag] -> Maybe (Splitter Prim) -> [FilePath] -> PatchSelectionContext Prim
-- | A PatchSelectionContext for selecting full patches
-- (PatchInfoAnd patches)
selectionContext :: (RepoPatch p) => String -> [DarcsFlag] -> Maybe (Splitter (PatchInfoAnd p)) -> [FilePath] -> PatchSelectionContext (PatchInfoAnd p)
instance Eq WhichChanges
instance Show WhichChanges
module Darcs.Commands.Annotate
annotate :: DarcsCommand
createdAsXml :: PatchInfo -> String -> Doc
module Darcs.Commands.Apply
apply :: DarcsCommand
module Darcs.Commands.Changes
changes :: DarcsCommand
log :: DarcsCommand
module Darcs.Repository.Repair
replayRepository :: (RepoPatch p) => Repository p -> [DarcsFlag] -> (RepositoryConsistency p -> IO a) -> IO a
checkIndex :: (RepoPatch p) => Repository p -> Bool -> IO Bool
data RepositoryConsistency p
RepositoryConsistent :: RepositoryConsistency p
BrokenPristine :: (Tree IO) -> RepositoryConsistency p
BrokenPatches :: (Tree IO) -> (PatchSet p) -> RepositoryConsistency p
module Darcs.Commands.Check
check :: DarcsCommand
module Darcs.Commands.Convert
convert :: DarcsCommand
module Darcs.Commands.Diff
diffCommand :: DarcsCommand
module Darcs.Commands.Dist
dist :: DarcsCommand
module Darcs.Commands.Init
initialize :: DarcsCommand
initializeCmd :: [DarcsFlag] -> [String] -> IO ()
module Darcs.Commands.Get
get :: DarcsCommand
clone :: DarcsCommand
module Darcs.Commands.GZCRCs
gzcrcs :: DarcsCommand
-- | This is designed for use in an atexit handler, e.g. in
-- Darcs.RunCommand
doCRCWarnings :: Bool -> IO ()
module Darcs.Commands.MarkConflicts
markconflicts :: DarcsCommand
-- | resolve is an alias for mark-conflicts.
resolve :: DarcsCommand
module Darcs.Commands.Move
move :: DarcsCommand
mv :: DarcsCommand
module Darcs.Commands.Optimize
optimize :: DarcsCommand
module Darcs.Commands.Push
push :: DarcsCommand
module Darcs.Commands.Put
put :: DarcsCommand
module Darcs.Commands.WhatsNew
whatsnew :: DarcsCommand
announceFiles :: (RepoPatch p) => Repository p -> [SubPath] -> String -> IO [SubPath]
module Darcs.Commands.Record
record :: DarcsCommand
commit :: DarcsCommand
getDate :: [DarcsFlag] -> IO String
getLog :: [DarcsFlag] -> Maybe (String, [String]) -> IO String -> FL Prim -> IO (String, [String], Maybe String)
askAboutDepends :: (RepoPatch p) => Repository p -> FL Prim -> [DarcsFlag] -> [PatchInfo] -> IO [PatchInfo]
module Darcs.Commands.AmendRecord
amendrecord :: DarcsCommand
module Darcs.Commands.Remove
remove :: DarcsCommand
rm :: DarcsCommand
unadd :: DarcsCommand
module Darcs.Commands.Repair
repair :: DarcsCommand
repairCmd :: [DarcsFlag] -> [String] -> IO ()
module Darcs.Commands.Replace
replace :: DarcsCommand
module Darcs.Commands.Unrevert
unrevert :: DarcsCommand
writeUnrevert :: (RepoPatch p) => Repository p -> FL Prim -> Tree IO -> FL Prim -> IO ()
module Darcs.Commands.Revert
revert :: DarcsCommand
module Darcs.Commands.Unrecord
unrecord :: DarcsCommand
unpull :: DarcsCommand
obliterate :: DarcsCommand
getLastPatches :: (RepoPatch p) => [DarcsFlag] -> PatchSet p -> FlippedSeal (RL (PatchInfoAnd p))
module Darcs.Commands.Rollback
rollback :: DarcsCommand
module Darcs.Commands.SetPref
setpref :: DarcsCommand
module Darcs.Commands.ShowAuthors
showAuthors :: DarcsCommand
module Darcs.Commands.ShowBug
showBug :: DarcsCommand
module Darcs.Commands.ShowContents
showContents :: DarcsCommand
module Darcs.Commands.ShowFiles
showFiles :: DarcsCommand
manifestCmd :: ([DarcsFlag] -> Tree IO -> [FilePath]) -> [DarcsFlag] -> [String] -> IO ()
toListManifest :: [DarcsFlag] -> Tree m -> [FilePath]
module Darcs.Commands.ShowTags
showTags :: DarcsCommand
module Darcs.Commands.ShowIndex
showIndex :: DarcsCommand
showPristineCmd :: [DarcsFlag] -> [String] -> IO ()
module Darcs.Commands.Tag
tag :: DarcsCommand
module Darcs.Commands.TrackDown
trackdown :: DarcsCommand
instance Show BisectDir
module Darcs.Commands.TransferMode
transferMode :: DarcsCommand
module Darcs.Commands.Pull
pull :: DarcsCommand
fetch :: DarcsCommand
module Darcs.Commands.ShowRepo
showRepo :: DarcsCommand
module Darcs.Commands.Show
showCommand :: DarcsCommand
list :: DarcsCommand
query :: DarcsCommand
module HTTP
fetchUrl :: String -> IO String
postUrl :: String -> String -> String -> IO ()
requestUrl :: String -> FilePath -> a -> IO String
waitNextUrl :: IO (String, String)
module Darcs.Commands.Send
send :: DarcsCommand
module Darcs.TheCommands
-- | The commands that darcs knows about (e.g. whatsnew, record), organized
-- into thematic groups. Note that hidden commands are also listed here.
commandControlList :: [CommandControl]
module Darcs.Commands.Help
helpCmd :: [DarcsFlag] -> [String] -> IO ()
commandControlList :: [CommandControl]
-- | Help on each environment variable in which Darcs is interested.
environmentHelp :: [([String], [String])]
printVersion :: IO ()
listAvailableCommands :: IO ()
module Darcs.ArgumentDefaults
getDefaultFlags :: String -> [DarcsOption] -> [DarcsFlag] -> IO [DarcsFlag]
module Darcs.RunCommand
runTheCommand :: [CommandControl] -> String -> [String] -> IO ()