-- 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: -- -- -- -- 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.4 module Darcs.Test.Patch.Check -- | PatchCheck is a state monad with a simulated repository state type PatchCheck = State KnownState do_check :: PatchCheck a -> a file_exists :: String -> PatchCheck Bool dir_exists :: String -> PatchCheck Bool remove_file :: String -> PatchCheck Bool remove_dir :: String -> PatchCheck Bool create_file :: String -> PatchCheck Bool create_dir :: String -> PatchCheck Bool insert_line :: String -> Int -> ByteString -> PatchCheck Bool delete_line :: String -> Int -> ByteString -> PatchCheck Bool -- | Returns true if the current repository state is not inconsistent is_valid :: PatchCheck Bool -- | Run a check, and print the final repository state do_verbose_check :: PatchCheck a -> a -- | Checks if a file is empty file_empty :: String -> PatchCheck Bool check_move :: String -> String -> PatchCheck Bool modify_file :: String -> (Maybe FileContents -> Maybe FileContents) -> PatchCheck Bool -- | File contents are represented by a map from line numbers to line -- contents. If for a certain line number, the line contents are Nothing, -- that means that we are sure that that line exists, but we don't know -- its contents. We must also store the greatest line number that is -- known to exist in a file, to be able to exclude the possibility of it -- being empty without knowing its contents. data FileContents FC :: Map Int ByteString -> Int -> FileContents fc_lines :: FileContents -> Map Int ByteString fc_maxline :: FileContents -> Int instance Show KnownState instance Eq Prop instance Eq FileContents instance Show FileContents instance Show Prop 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 class Show1 a show1 :: (Show1 a) => a -> String showsPrec1 :: (Show1 a) => Int -> a -> ShowS class Show2 a show2 :: (Show2 a) => a -> String showsPrec2 :: (Show2 a) => Int -> a -> ShowS showOp2 :: (Show2 a, Show2 b) => Int -> String -> Int -> a -> b -> String -> String app_prec :: 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: -- -- -- -- 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: -- -- 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: -- -- 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 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: -- -- 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 -> (Exception -> IO a) -> IO a tryNonSignal :: IO a -> IO (Either Exception a) stdout_is_a_pipe :: IO Bool instance Typeable 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 unsafeUnflippedseal :: 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 instance (Show2 a) => Show (Sealed2 a) instance (Show1 a) => Show (Sealed a) -- | 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 break_on_dir :: FileName -> Maybe (FileName, FileName) norm_path :: FileName -> FileName own_name :: FileName -> FileName superName :: FileName -> FileName movedirfilename :: FileName -> FileName -> FileName -> FileName -- | encode_white translates whitespace in filenames to a -- darcs-specific format (backslash followed by numerical representation -- according to ord). Note that backslashes are also escaped since -- they are used in the encoding. -- --
--   encode_white "hello there" == "hello\32there"
--   encode_white "hello\there" == "hello\\there"
--   
encode_white :: FilePath -> String -- | decode_white interprets the Darcs-specific "encoded" filenames -- produced by encode_white -- --
--   decode_white "hello\32there" == "hello there"
--   decode_white "hello\\there"  == "hello\there"
--   decode_white "hello\there"   == error "malformed filename"
--   
decode_white :: String -> FilePath (///) :: FileName -> FileName -> FileName -- | Split a file path at the slashes breakup :: String -> [String] instance Eq FileName instance Ord FileName instance Show FileName 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 date_time 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, -- -- -- -- 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, -- -- 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., -- -- -- -- See iso8601_duration iso8601_interval :: Int -> CharParser a (Either TimeDiff (MCalendarTime, MCalendarTime)) -- | Durations in ISO 8601, e.g., -- -- iso8601_duration :: 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 () with_atexit :: 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, 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 -- | 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 () 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) is_funky :: 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) break_after_nth_newline :: Int -> ByteString -> Maybe (ByteString, ByteString) break_before_nth_newline :: 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 module Darcs.Patch.ReadMonads class (Monad m) => ParserM m work :: (ParserM m) => (ByteString -> Maybe (a, ByteString)) -> m a maybe_work :: (ParserM m) => (ByteString -> Maybe (a, ByteString)) -> m (Maybe a) peek_input :: (ParserM m) => m ByteString alter_input :: (ParserM m) => (ByteString -> ByteString) -> m () parse_strictly :: SM a -> ByteString -> Maybe (a, ByteString) parse_lazily :: LM a -> ByteString -> (a, ByteString) lex_char :: (ParserM m) => Char -> m () lex_string :: (ParserM m) => String -> m () lex_strings :: (ParserM m) => [String] -> m String lex_eof :: (ParserM m) => m () my_lex :: ByteString -> Maybe (ByteString, ByteString) instance ParserM LM instance Monad LM instance ParserM SM instance Monad SM module HTTP fetchUrl :: String -> IO String postUrl :: String -> String -> String -> IO () request_url :: String -> FilePath -> a -> IO String wait_next_url :: IO (String, String) module Darcs.Patch.MatchData data PatchMatch PatternMatch :: String -> PatchMatch patch_match :: 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 exec_interactive :: 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 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 insert_before_lastline :: 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 -- | wrap_text n s is a Doc representing s -- line-wrapped at n characters wrap_text :: 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 unsafeUnFL :: FL a -> [a] unsafeFL :: [a] -> FL a unsafeRL :: [a] -> RL a unsafeUnRL :: RL a -> [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 splitAtFL :: Int -> FL a -> (FL a :> FL 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] filterFL :: (p -> EqCheck) -> FL p -> FL 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 unsafeCoerceP :: a -> a unsafeCoerceP2 :: t -> t instance (Show2 a) => Show2 (FL a) instance (Show2 a) => Show (FL 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 (Show2 a, Show2 b) => Show (a :> b) instance Show EqCheck instance Eq EqCheck -- | Path resolving: -- -- -- -- 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 is_file :: String -> Bool is_url :: String -> Bool is_ssh :: String -> Bool is_relative :: String -> Bool is_absolute :: String -> Bool is_ssh_nopath :: 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 -> IO a) -> IO a -> AbsolutePathOrStd -> IO a 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 :: Exception -> String prettyError :: IOError -> String putStrLnError :: String -> IO () putDocLnError :: Doc -> IO () withCurrentDirectory :: (FilePathLike p) => p -> IO a -> IO a withUMask :: String -> IO a -> IO a askUser :: String -> IO String stripCr :: String -> String showHexLen :: (Integral a) => Int -> a -> String add_to_error_loc :: Exception -> String -> Exception 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) isUnsupportedOperationError :: IOError -> Bool isHardwareFaultError :: IOError -> Bool get_viewer :: IO String edit_file :: (FilePathLike p) => p -> IO ExitCode run_editor :: FilePath -> IO ExitCode promptYorn :: [Char] -> IO Char promptCharFancy :: String -> [Char] -> Maybe Char -> [Char] -> IO Char environmentHelpEditor :: ([String], [String]) environmentHelpPager :: ([String], [String]) formatPath :: String -> String -- | 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 module Darcs.Compat stdout_is_a_pipe :: IO Bool mk_stdout_temp :: String -> IO String canonFilename :: FilePath -> IO FilePath maybeRelink :: String -> String -> IO Bool atomic_create :: FilePath -> IO () sloppy_atomic_create :: 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 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 UseHashedInventory :: DarcsFlag UseOldFashionedInventory :: DarcsFlag UseFormat2 :: DarcsFlag PristinePlain :: DarcsFlag PristineNone :: DarcsFlag NoUpdateWorking :: DarcsFlag Sibling :: AbsolutePath -> DarcsFlag Relink :: DarcsFlag RelinkPristine :: DarcsFlag NoLinks :: DarcsFlag OptimizePristine :: 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 HTTPPipelining :: DarcsFlag NoHTTPPipelining :: DarcsFlag NoCache :: DarcsFlag AllowUnrelatedRepos :: DarcsFlag Check :: DarcsFlag Repair :: DarcsFlag JustThisRepo :: DarcsFlag NullFlag :: DarcsFlag data Compression NoCompression :: Compression GzipCompression :: Compression compression :: [DarcsFlag] -> Compression want_external_merge :: [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 instance Eq DarcsFlag instance Show DarcsFlag -- | 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.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 () writeDocBinFile :: (FilePathLike p) => p -> Doc -> IO () appendBinFile :: (FilePathLike p) => p -> String -> IO () appendDocBinFile :: (FilePathLike p) => p -> Doc -> IO () readBinFile :: (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 () rm_recursive :: FilePath -> IO () removeFileMayNotExist :: (FilePathLike p) => p -> IO () canonFilename :: FilePath -> IO FilePath maybeRelink :: String -> String -> IO Bool world_readable_temp :: String -> IO String tempdir_loc :: IO FilePath editText :: String -> ByteString -> IO ByteString environmentHelpTmpdir :: ([String], [String]) environmentHelpKeepTmpdir :: ([String], [String]) module Darcs.CheckFileSystem can_I_use_mmap :: IO Bool 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 module Darcs.Email make_email :: String -> [(String, String)] -> (Maybe Doc) -> Doc -> (Maybe String) -> Doc read_email :: 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 () pipeliningEnabledByDefault :: Bool setDebugHTTP :: IO () setHTTPPipelining :: Bool -> IO () 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 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 () sendmail_path :: IO String diff_program :: IO String -- | Get the name of the darcs executable (as supplied by -- getProgName) darcs_program :: 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. get_motd :: String -> IO ByteString -- | Display the message of the day for a given repository, unless either -- the XMLOutput or the Quiet flags are passed in show_motd :: [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 remote_apply :: [DarcsFlag] -> String -> Doc -> IO ExitCode apply_as :: [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 (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 commuteFL :: (Commute p) => (p :> FL p) -> Either (Sealed2 p) ((FL p :> p)) commuteRL :: (Commute p) => (RL p :> p) -> Maybe ((p :> RL 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) => 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) -- | 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 head_permutationsFL :: (Commute p) => FL p -> [FL p] -- | head_permutationsRL 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). head_permutationsRL :: (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)] -- | remove_subsequenceFL 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. remove_subsequenceFL :: (MyEq p, Commute p) => FL p -> FL p -> Maybe (FL p) -- | remove_subsequenceRL is like remove_subsequenceFL -- except that it works on RL remove_subsequenceRL :: (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 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 is_identity :: 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, CommuteFunction)] -- | 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 try_tok_internal :: String -> ByteString -> ByteString -> ByteString -> Maybe [ByteString] try_shrinking_inverse :: FL Prim -> Maybe (FL Prim) n_fn :: 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)]] commute_no_conflicts :: (Conflict p) => (p :> p) -> Maybe ((p :> p)) conflictedEffect :: (Conflict p) => p -> [IsConflictedPrim] -- | 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) commute_no_conflictsFL :: (Conflict p) => (p :> FL p) -> Maybe ((FL p :> p)) commute_no_conflictsRL :: (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 -- | SlurpDirectory is intended to give a nice lazy way of traversing -- directory trees. module Darcs.SlurpDirectory.Internal data Slurpy Slurpy :: !FileName -> !SlurpyContents -> Slurpy data SlurpyContents SlurpDir :: (Maybe String) -> SlurpyMap -> SlurpyContents SlurpFile :: (Maybe String, EpochTime, FileOffset) -> FileContents -> SlurpyContents slurpies_to_map :: [Slurpy] -> SlurpyMap map_to_slurpies :: SlurpyMap -> [Slurpy] type FileContents = ByteString empty_slurpy :: Slurpy slurp :: (FilePathLike p) => p -> IO Slurpy mmap_slurp :: FilePath -> IO Slurpy slurp_unboring :: (FilePath -> Bool) -> FilePath -> IO Slurpy co_slurp :: Slurpy -> FilePath -> IO Slurpy slurp_name :: Slurpy -> FilePath is_file :: Slurpy -> Bool is_dir :: Slurpy -> Bool get_filecontents :: Slurpy -> FileContents get_dircontents :: Slurpy -> [Slurpy] get_mtime :: Slurpy -> EpochTime get_length :: Slurpy -> FileOffset get_slurp :: FileName -> Slurpy -> Maybe Slurpy slurp_removefile :: FileName -> Slurpy -> Maybe Slurpy slurp_removedir :: FileName -> Slurpy -> Maybe Slurpy -- | A variant of get_slurp_context that allows for replacing the -- child slurpy by a list of slurpies. The result of the update function -- will always be a singleton list unless the child slurpy was at the top -- level. Currently unused. get_slurp_context_list :: FileName -> -- Slurpy -> Maybe ([Slurpy] -> [Slurpy], Slurpy) -- get_slurp_context_list = get_slurp_context_generic return id -- -- It is important to be able to readily modify a slurpy. slurp_remove :: FileName -> Slurpy -> Maybe Slurpy -- | Code to modify a given file in a slurpy. slurp_modfile :: FileName -> (FileContents -> Maybe FileContents) -> Slurpy -> Maybe Slurpy slurp_hasfile :: FileName -> Slurpy -> Bool slurp_hasdir :: FileName -> Slurpy -> Bool slurp_has_anycase :: FilePath -> Slurpy -> Bool undefined_time :: EpochTime undefined_size :: FileOffset slurp_has :: FilePath -> Slurpy -> Bool list_slurpy :: Slurpy -> [FilePath] list_slurpy_files :: Slurpy -> [FilePath] get_path_list :: Slurpy -> FilePath -> [FilePath] list_slurpy_dirs :: Slurpy -> [FilePath] isFileReallySymlink :: FilePath -> IO Bool doesFileReallyExist :: FilePath -> IO Bool doesDirectoryReallyExist :: FilePath -> IO Bool data SlurpMonad a withSlurpy :: Slurpy -> SlurpMonad a -> Either String (Slurpy, a) write_files :: Slurpy -> [FilePath] -> IO () writeSlurpy :: Slurpy -> FilePath -> IO () syncSlurpy :: (Slurpy -> IO Slurpy) -> Slurpy -> IO Slurpy instance WriteableDirectory SlurpMonad instance ReadableDirectory SlurpMonad instance MonadPlus SlurpMonad instance Monad SlurpMonad instance Functor SlurpMonad instance Ord Slurpy instance Eq Slurpy instance Show Slurpy module Darcs.SlurpDirectory data Slurpy empty_slurpy :: Slurpy slurp :: (FilePathLike p) => p -> IO Slurpy mmap_slurp :: FilePath -> IO Slurpy co_slurp :: Slurpy -> FilePath -> IO Slurpy slurp_unboring :: (FilePath -> Bool) -> FilePath -> IO Slurpy type FileContents = ByteString undefined_time :: EpochTime undefined_size :: FileOffset doesFileReallyExist :: FilePath -> IO Bool doesDirectoryReallyExist :: FilePath -> IO Bool isFileReallySymlink :: FilePath -> IO Bool is_dir :: Slurpy -> Bool is_file :: Slurpy -> Bool get_slurp :: FileName -> Slurpy -> Maybe Slurpy slurp_name :: Slurpy -> FilePath slurp_has :: FilePath -> Slurpy -> Bool slurp_has_anycase :: FilePath -> Slurpy -> Bool slurp_hasfile :: FileName -> Slurpy -> Bool slurp_hasdir :: FileName -> Slurpy -> Bool list_slurpy :: Slurpy -> [FilePath] list_slurpy_files :: Slurpy -> [FilePath] list_slurpy_dirs :: Slurpy -> [FilePath] get_path_list :: Slurpy -> FilePath -> [FilePath] get_filecontents :: Slurpy -> FileContents get_dircontents :: Slurpy -> [Slurpy] get_mtime :: Slurpy -> EpochTime get_length :: Slurpy -> FileOffset -- | Code to modify a given file in a slurpy. slurp_modfile :: FileName -> (FileContents -> Maybe FileContents) -> Slurpy -> Maybe Slurpy -- | A variant of get_slurp_context that allows for replacing the -- child slurpy by a list of slurpies. The result of the update function -- will always be a singleton list unless the child slurpy was at the top -- level. Currently unused. get_slurp_context_list :: FileName -> -- Slurpy -> Maybe ([Slurpy] -> [Slurpy], Slurpy) -- get_slurp_context_list = get_slurp_context_generic return id -- -- It is important to be able to readily modify a slurpy. slurp_remove :: FileName -> Slurpy -> Maybe Slurpy slurp_removefile :: FileName -> Slurpy -> Maybe Slurpy slurp_removedir :: FileName -> Slurpy -> Maybe Slurpy write_files :: Slurpy -> [FilePath] -> IO () data SlurpMonad a withSlurpy :: Slurpy -> SlurpMonad a -> Either String (Slurpy, a) writeSlurpy :: Slurpy -> FilePath -> IO () syncSlurpy :: (Slurpy -> IO Slurpy) -> Slurpy -> IO Slurpy module SHA1 sha1PS :: ByteString -> String module Darcs.Patch.Info data PatchInfo patchinfo :: String -> String -> String -> [String] -> IO PatchInfo invert_name :: PatchInfo -> PatchInfo is_inverted :: PatchInfo -> Bool idpatchinfo :: PatchInfo add_junk :: PatchInfo -> IO PatchInfo make_filename :: PatchInfo -> String make_alt_filename :: PatchInfo -> String readPatchInfo :: ByteString -> Maybe (PatchInfo, ByteString) just_name :: PatchInfo -> String just_author :: PatchInfo -> String repopatchinfo :: String -> PatchInfo -> RepoPatchInfo data RepoPatchInfo human_friendly :: PatchInfo -> Doc to_xml :: PatchInfo -> Doc pi_date :: PatchInfo -> CalendarTime set_pi_date :: String -> PatchInfo -> PatchInfo pi_name :: PatchInfo -> String pi_rename :: PatchInfo -> String -> PatchInfo pi_author :: PatchInfo -> String pi_tag :: PatchInfo -> Maybe String pi_log :: 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 is_tag :: 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 join_patchesFL :: 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 n_fn :: 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) merger_undo :: 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 Show Patch module Darcs.Patch.Commute fromPrims :: (FromPrims p) => FL Prim -> p modernizePatch :: Patch -> Patch merge :: (Commute p) => (p :\/: p) -> (p :/\: p) elegantMerge :: (Patch :\/: Patch) -> Maybe ((Patch :/\: Patch)) merger :: String -> Patch -> Patch -> Patch unravel :: Patch -> [FL Prim] public_unravel :: Patch -> [Sealed (FL Prim)] mangle_unravelled :: [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 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 () -- | 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] 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] instance Eq FileType module Darcs.Patch.Apply applyToFilepaths :: (Apply p) => p -> [FilePath] -> [FilePath] applyToSlurpy :: (Apply p, Monad m) => p -> Slurpy -> m Slurpy 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)] forceReplaceSlurpy :: Prim -> Slurpy -> Maybe Slurpy 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 -- | Convenience type for non primitive patches type NonPatch = Non Prim -- | 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) prop_adjust_twice :: (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: -- -- -- -- 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 is_consistent :: RealPatch -> Maybe Doc -- | This is only used for unit testing is_forward :: RealPatch -> Maybe Doc -- | is_duplicate p is ' True if p is -- either a Duplicate or Etacilpud patch is_duplicate :: 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 (MyEq p) => Eq (Sealed p) 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: -- -- -- -- 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 merger :: String -> Patch -> Patch -> Patch 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 unravel :: Patch -> [FL Prim] 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 commuteFL :: (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 applyToSlurpy :: (Apply p, Monad m) => p -> Slurpy -> m Slurpy patchname :: Named p -> String patchcontents :: Named p -> p applyToFilepaths :: (Apply p) => p -> [FilePath] -> [FilePath] forceReplaceSlurpy :: Prim -> Slurpy -> Maybe Slurpy 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 :: Patch -> Patch -- | 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 -- | 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 -- | 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 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) 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.Patch.Set -- | A PatchSet is in reverse order, plus has information about which tags -- are clean, meaning all patches applied prior to them are in the tag -- itself, so we can stop reading at that point. Just to clarify, the -- first patch in a PatchSet is the one most recently applied to the -- repo. -- -- PatchSets have the property that if (info $ last $ head a) -- == (info $ last $ head b) then (tail a) and (tail -- b) are identical repositories -- -- Questions: -- -- Does this mean that in a patch set such as [[a b t1 c d e t2][f g -- t3] [h i]], t1, t2 and t3 are tags, and t2 and t3 are clean? -- -- Can we have PatchSet with length at least 3? Florent type PatchSet p = RL (RL (PatchInfoAnd p)) type SealedPatchSet p = Sealed (RL (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. check_paths :: (Patchy p) => [DarcsFlag] -> FL p -> IO () -- | Filter out patches that contains some malicious file path malicious_patches :: (Patchy p) => [Sealed2 p] -> [Sealed2 p] has_malicious_path :: (Patchy p) => p -> Bool module Darcs.Patch.Depends get_common_and_uncommon :: (RepoPatch p) => (PatchSet p, PatchSet p) -> ([PatchInfo], RL (PatchInfoAnd p) :\/: RL (PatchInfoAnd p)) get_tags_right :: RL (RL (PatchInfoAnd p)) -> [PatchInfo] get_common_and_uncommon_or_missing :: (RepoPatch p) => (PatchSet p, PatchSet p) -> Either PatchInfo ([PatchInfo], RL (PatchInfoAnd p) :\/: RL (PatchInfoAnd p)) optimize_patchset :: PatchSet p -> PatchSet p deep_optimize_patchset :: PatchSet p -> PatchSet p slightly_optimize_patchset :: PatchSet p -> PatchSet p get_patches_beyond_tag :: (RepoPatch p) => PatchInfo -> PatchSet p -> FlippedSeal (RL (PatchInfoAnd p)) -- | get_patches_in_tag t ps returns a SealedPatchSet of -- all patches in ps which are contained in t. get_patches_in_tag :: (RepoPatch p) => PatchInfo -> PatchSet p -> SealedPatchSet p patchset_union :: (RepoPatch p) => [SealedPatchSet p] -> SealedPatchSet p patchset_intersection :: (RepoPatch p) => [SealedPatchSet p] -> SealedPatchSet p commute_to_end :: (RepoPatch p) => FL (Named p) -> PatchSet p -> (FL (Named p) :< RL (RL (PatchInfoAnd p))) instance Error MissingPatch module Darcs.Patch.Bundle hash_bundle :: (RepoPatch p) => [PatchInfo] -> FL (Named p) -> String make_bundle :: (RepoPatch p) => [DarcsFlag] -> Tree IO -> [PatchInfo] -> FL (Named p) -> IO Doc -- | In make_bundle2, 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. make_bundle2 :: (RepoPatch p) => [DarcsFlag] -> Tree IO -> [PatchInfo] -> FL (Named p) -> FL (Named p) -> IO Doc scan_bundle :: (RepoPatch p) => ByteString -> Either String (SealedPatchSet p) make_context :: [PatchInfo] -> Doc scan_context :: (RepoPatch p) => ByteString -> PatchSet p module Darcs.Diff treeDiff :: (FilePath -> FileType) -> Tree IO -> Tree IO -> IO (FL Prim) module Darcs.Repository.ApplyPatches apply_patches :: (Patchy p) => [DarcsFlag] -> FL (PatchInfoAnd p) -> IO () apply_patches_with_feedback :: (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 patch_match :: String -> PatchMatch match_pattern :: (Patchy p) => PatchMatch -> Matcher p -- | apply_matcher applies a matcher to a patch. apply_matcher :: Matcher p -> PatchInfoAnd p -> Bool make_matcher :: String -> (Sealed2 (PatchInfoAnd p) -> Bool) -> Matcher p parseMatch :: (Patchy p) => PatchMatch -> Either String (MatchFun p) match_parser :: (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 standard_resolution :: (RepoPatch p) => p -> Sealed (FL Prim) external_resolution :: (RepoPatch p) => Tree IO -> String -> FL Prim -> FL Prim -> p -> IO (Sealed (FL Prim)) patchset_conflict_resolutions :: (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 actually 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. -- 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). 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 :: TaggedPatch p -> PatchChoices p -> Slot getChoices :: (Patchy p) => PatchChoices p -> (FL (TaggedPatch p) :> (FL (TaggedPatch p) :> FL (TaggedPatch 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 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 (Commute p) => Commute (PatchChoice p) instance (Invert p) => Invert (PatchChoice p) instance (MyEq p) => MyEq (PatchChoice p) instance (Commute p) => Commute (TaggedPatch p) instance (Invert p) => Invert (TaggedPatch p) instance (MyEq p) => MyEq (TaggedPatch p) module Darcs.Patch.TouchesFiles look_touch :: (Patchy p) => [FilePath] -> p -> (Bool, [FilePath]) choose_touching :: (Patchy p) => [FilePath] -> FL p -> Sealed (FL p) select_touching :: (Patchy p) => [FilePath] -> PatchChoices p -> PatchChoices p deselect_not_touching :: (Patchy p) => [FilePath] -> PatchChoices p -> PatchChoices p select_not_touching :: (Patchy p) => [FilePath] -> PatchChoices p -> PatchChoices p module Darcs.Patch.Properties recommute :: (Patchy p) => (((p :> p) -> Maybe ((p :> p)))) -> (p :> p) -> Maybe Doc commute_inverses :: (Patchy p) => ((p :> p) -> Maybe ((p :> p))) -> (p :> p) -> Maybe Doc permutivity :: (Patchy p) => ((p :> p) -> Maybe ((p :> p))) -> (p :> (p :> p)) -> Maybe Doc partial_permutivity :: (Patchy p) => ((p :> p) -> Maybe ((p :> p))) -> (p :> (p :> p)) -> Maybe Doc identity_commutes :: (Patchy p) => p -> Maybe Doc inverse_doesnt_commute :: (Patchy p) => p -> Maybe Doc patch_and_inverse_commute :: (Patchy p) => ((p :> p) -> Maybe ((p :> p))) -> (p :> p) -> Maybe Doc merge_either_way :: (Patchy p) => (p :\/: p) -> Maybe Doc show_read :: (Show2 p, Patchy p) => p -> Maybe Doc merge_commute :: (Patchy p) => (p :\/: p) -> Maybe Doc merge_consistent :: (Patchy p) => (p -> Maybe Doc) -> (p :\/: p) -> Maybe Doc merge_arguments_consistent :: (Patchy p) => (p -> Maybe Doc) -> (p :\/: p) -> Maybe Doc join_inverses :: ((Prim :> Prim) -> Maybe (Prim)) -> Prim -> Maybe Doc join_commute :: ((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 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) slurpPristine :: Pristine -> IO (Maybe Slurpy) 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 write_inventory :: (RepoPatch p) => FilePath -> PatchSet p -> IO () write_inventory_and_patches :: (RepoPatch p) => [DarcsFlag] -> PatchSet p -> IO () add_to_inventory :: FilePath -> [PatchInfo] -> IO () add_to_tentative_pristine :: (Effect p) => p -> IO () add_to_tentative_inventory :: (RepoPatch p) => [DarcsFlag] -> Named p -> IO FilePath remove_from_tentative_inventory :: (RepoPatch p) => Bool -> [DarcsFlag] -> FL (Named p) -> IO () finalize_tentative_changes :: IO () finalize_pristine_changes :: IO () revert_tentative_changes :: IO () read_repo :: (RepoPatch p) => [DarcsFlag] -> String -> IO (SealedPatchSet p) read_tentative_repo :: (RepoPatch p) => [DarcsFlag] -> String -> IO (SealedPatchSet p) write_and_read_patch :: (RepoPatch p) => [DarcsFlag] -> PatchInfoAnd p -> IO (PatchInfoAnd p) copy_patches :: [DarcsFlag] -> FilePath -> FilePath -> [PatchInfo] -> IO () module Darcs.Repository.LowLevel read_pending :: (RepoPatch p) => Repository p -> IO (Sealed (FL Prim)) read_pendingfile :: 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 (forall t m. (FilterTree t m) => t m -> t 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 ((FilterTree t m) => t m -> t 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, exactly the files that live under any of these paths -- in either recorded or unrecorded will be included in the resulting -- patch. -- -- 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)) pendingChanges :: (RepoPatch p) => Repository p -> [SubPath] -> 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. readUnrecorded :: (RepoPatch p) => Repository p -> IO (Tree IO) 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 () module Darcs.Repository.HashedIO type HashedIO r p = StateT (HashDir r p) IO applyHashed :: (Patchy q) => Cache -> [DarcsFlag] -> String -> q -> IO String copyHashed :: String -> Cache -> Compression -> String -> IO () copyPartialsHashed :: (FilePathLike fp) => Cache -> Compression -> String -> [fp] -> IO () -- | Seems to list all hashes reachable from root. listHashedContents :: String -> Cache -> String -> IO [String] -- | Create a Slurpy representing the pristine content determined by the -- supplied root hash (which uniquely determines the pristine tree) slurpHashedPristine :: Cache -> Compression -> String -> IO Slurpy -- | Write contents of a Slurpy into hashed pristine. Only files that have -- not not yet been hashed (that is, the hash corresponding to their -- content is already present in hashed pristine) will be written out, so -- it is efficient to use this function to update existing pristine -- cache. Note that the pristine root hash will *not* be updated. You -- need to do that manually. writeHashedPristine :: Cache -> Compression -> Slurpy -> IO String clean_hashdir :: Cache -> HashedDir -> [String] -> IO () instance Eq ObjType instance WriteableDirectory (HashedIO RW p) instance ReadableDirectory (HashedIO r p) module Darcs.Repository.HashedRepo revert_tentative_changes :: IO () finalize_tentative_changes :: (RepoPatch p) => Repository p -> Compression -> IO () slurp_pristine :: Cache -> Compression -> String -> String -> IO Slurpy clean_pristine :: Repository p -> IO () copy_pristine :: Cache -> Compression -> String -> String -> IO () copy_partials_pristine :: (FilePathLike fp) => Cache -> Compression -> String -> String -> [fp] -> IO () apply_to_tentative_pristine :: (Patchy q) => Cache -> [DarcsFlag] -> q -> IO () add_to_tentative_inventory :: (RepoPatch p) => Cache -> Compression -> PatchInfoAnd p -> IO FilePath remove_from_tentative_inventory :: (RepoPatch p) => Repository p -> Compression -> FL (Named p) -> IO () read_repo :: (RepoPatch p) => Repository p -> String -> IO (PatchSet p) read_tentative_repo :: (RepoPatch p) => Repository p -> String -> IO (PatchSet p) write_and_read_patch :: (RepoPatch p) => Cache -> Compression -> PatchInfoAnd p -> IO (PatchInfoAnd p) write_tentative_inventory :: (RepoPatch p) => Cache -> Compression -> PatchSet p -> IO () copy_repo :: (RepoPatch p) => Repository p -> [DarcsFlag] -> String -> IO () slurp_all_but_darcs :: FilePath -> IO Slurpy readHashedPristineRoot :: Repository p -> IO (Maybe String) pris2inv :: String -> ByteString -> Doc 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 (Either String (Repository p)) identifyDarcs1Repository :: [DarcsFlag] -> String -> IO (Repository Patch) identifyRepositoryFor :: (RepoPatch p) => Repository p -> String -> IO (Repository p) findRepository :: [DarcsFlag] -> IO (Either String ()) amInRepository :: [DarcsFlag] -> IO (Either String ()) amNotInRepository :: [DarcsFlag] -> IO (Either String ()) slurp_pending :: (RepoPatch p) => Repository p -> IO Slurpy revertRepositoryChanges :: (RepoPatch p) => Repository p -> IO () slurp_recorded :: (RepoPatch p) => Repository p -> IO Slurpy slurp_recorded_and_unrecorded :: (RepoPatch p) => Repository p -> IO (Slurpy, Slurpy) announce_merge_conflicts :: 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 () check_unrecorded_conflicts :: (RepoPatch p) => [DarcsFlag] -> FL (Named p) -> IO Bool withRecorded :: (RepoPatch p) => Repository p -> ((AbsolutePath -> IO a) -> IO a) -> (AbsolutePath -> IO a) -> IO a read_repo :: (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 () tentativelyRemovePatches :: (RepoPatch p) => Repository p -> [DarcsFlag] -> FL (Named p) -> IO () -- | 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 () tentativelyReplacePatches :: (RepoPatch p) => Repository p -> [DarcsFlag] -> FL (Named p) -> IO () finalizeRepositoryChanges :: (RepoPatch p) => Repository p -> IO () unrevertUrl :: Repository p -> String applyToWorking :: (Patchy p) => Repository p1 -> [DarcsFlag] -> p -> IO () patchSetToPatches :: (RepoPatch p) => RL (RL (PatchInfoAnd 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 -- | A PatchSet is in reverse order, plus has information about which tags -- are clean, meaning all patches applied prior to them are in the tag -- itself, so we can stop reading at that point. Just to clarify, the -- first patch in a PatchSet is the one most recently applied to the -- repo. -- -- PatchSets have the property that if (info $ last $ head a) -- == (info $ last $ head b) then (tail a) and (tail -- b) are identical repositories -- -- Questions: -- -- Does this mean that in a patch set such as [[a b t1 c d e t2][f g -- t3] [h i]], t1, t2 and t3 are tags, and t2 and t3 are clean? -- -- Can we have PatchSet with length at least 3? Florent type PatchSet p = RL (RL (PatchInfoAnd p)) type SealedPatchSet p = Sealed (RL (RL (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 () -- | 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 () make_new_pending :: (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 get_checkpoint :: (RepoPatch p) => Repository p -> IO (Maybe (Sealed (Named p))) get_checkpoint_by_default :: (RepoPatch p) => Repository p -> IO (Maybe (Sealed (Named p))) identify_checkpoint :: (RepoPatch p) => Repository p -> IO (Maybe PatchInfo) write_checkpoint_patch :: (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 ($-) :: ((forall p. (RepoPatch p) => Repository p -> IO a) -> IO a) -> (forall p. (RepoPatch p) => Repository p -> IO a) -> IO a maybeIdentifyRepository :: [DarcsFlag] -> String -> IO (Either String (Repository 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 ()) slurp_pending :: (RepoPatch p) => Repository p -> IO Slurpy -- | Replace the existing pristine with a new one (loaded up in a Tree -- object). replacePristine :: Repository p -> Tree IO -> IO () slurp_recorded :: (RepoPatch p) => Repository p -> IO Slurpy slurp_recorded_and_unrecorded :: (RepoPatch p) => Repository p -> IO (Slurpy, Slurpy) withRecorded :: (RepoPatch p) => Repository p -> ((AbsolutePath -> IO a) -> IO a) -> (AbsolutePath -> IO a) -> IO a read_repo :: (RepoPatch p) => Repository p -> IO (PatchSet p) prefsUrl :: Repository p -> String add_to_pending :: (RepoPatch p) => Repository p -> FL Prim -> IO () tentativelyAddPatch :: (RepoPatch p) => Repository p -> [DarcsFlag] -> PatchInfoAnd p -> IO () tentativelyRemovePatches :: (RepoPatch p) => Repository p -> [DarcsFlag] -> FL (Named p) -> IO () -- | 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 (Named p) -> IO () 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 () copy_oldrepo_patches :: (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 () patchSetToPatches :: (RepoPatch p) => RL (RL (PatchInfoAnd 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 -- | A PatchSet is in reverse order, plus has information about which tags -- are clean, meaning all patches applied prior to them are in the tag -- itself, so we can stop reading at that point. Just to clarify, the -- first patch in a PatchSet is the one most recently applied to the -- repo. -- -- PatchSets have the property that if (info $ last $ head a) -- == (info $ last $ head b) then (tail a) and (tail -- b) are identical repositories -- -- Questions: -- -- Does this mean that in a patch set such as [[a b t1 c d e t2][f g -- t3] [h i]], t1, t2 and t3 are tags, and t2 and t3 are clean? -- -- Can we have PatchSet with length at least 3? Florent type PatchSet p = RL (RL (PatchInfoAnd p)) type SealedPatchSet p = Sealed (RL (RL (PatchInfoAnd 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 :: [DarcsFlag] -> [PatchInfo] -> PatchSet p -> PatchSet p -> IO () testTentative :: (RepoPatch p) => Repository p -> IO () testRecorded :: (RepoPatch p) => Repository p -> IO () -- | 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. readUnrecorded :: (RepoPatch p) => Repository p -> 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, exactly the files that live under any of these paths -- in either recorded or unrecorded will be included in the resulting -- patch. -- -- 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)) pendingChanges :: (RepoPatch p) => Repository p -> [SubPath] -> 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 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 UseHashedInventory :: DarcsFlag UseOldFashionedInventory :: DarcsFlag UseFormat2 :: DarcsFlag PristinePlain :: DarcsFlag PristineNone :: DarcsFlag NoUpdateWorking :: DarcsFlag Sibling :: AbsolutePath -> DarcsFlag Relink :: DarcsFlag RelinkPristine :: DarcsFlag NoLinks :: DarcsFlag OptimizePristine :: 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 HTTPPipelining :: DarcsFlag NoHTTPPipelining :: DarcsFlag NoCache :: DarcsFlag AllowUnrelatedRepos :: DarcsFlag Check :: DarcsFlag Repair :: DarcsFlag JustThisRepo :: DarcsFlag NullFlag :: DarcsFlag flagToString :: [DarcsOption] -> DarcsFlag -> Maybe String maxCount :: [DarcsFlag] -> Maybe Int isin :: (String -> DarcsFlag) -> [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 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 DarcsOption -- | DarcsArgOption shortSwitches longSwitches mkFlag ArgDescr -- OptDescr The constructor for options with a string argument, such -- as --tag DarcsArgOption :: [Char] -> [String] -> (String -> DarcsFlag) -> String -> String -> DarcsOption -- | 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 -> DarcsOption -- | DarcsAbsPathOrStdOption shortSwitches longSwitches mkFlag ArgDescr -- OptDescr The constructor for options with a path argument, such -- as -o DarcsAbsPathOrStdOption :: [Char] -> [String] -> (AbsolutePathOrStd -> DarcsFlag) -> String -> String -> DarcsOption -- | 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 -> DarcsOption -- | DarcsNoArgOption shortSwitches longSwitches mkFlag optDescr -- The constructon fon options with no arguments. DarcsNoArgOption :: [Char] -> [String] -> DarcsFlag -> String -> DarcsOption -- | A constructor for grouping related options together, such as -- --hashed, --darcs-2 and -- --old-fashioned-inventory. DarcsMultipleChoiceOption :: [DarcsOption] -> 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 testByDefault :: [DarcsFlag] -> [DarcsFlag] -- | 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 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 :: DarcsOption fancyMoveAdd :: DarcsOption setScriptsExecutableOption :: 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 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 -> 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 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 get_test :: [DarcsFlag] -> IO (IO ExitCode) run_posthook :: [DarcsFlag] -> AbsolutePath -> IO ExitCode run_prehook :: [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 modified_to_xml :: Info -> Doc lookup_pop :: FilePath -> Population -> Maybe Population lookup_creation_pop :: 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 instance (RepoPatch p) => MatchMonad SlurpMonad p instance (RepoPatch p) => MatchMonad IO p module Darcs.SelectChanges with_selected_changes' :: WithPatches Prim a with_selected_changes_to_files' :: WithPatchesToFiles Prim a with_selected_last_changes_to_files' :: WithPatchesToFiles Prim a with_selected_last_changes_reversed' :: WithPatches Prim a with_selected_changes :: (RepoPatch p) => WithPatches (PatchInfoAnd p) a with_selected_changes_to_files :: (RepoPatch p) => WithPatchesToFiles (PatchInfoAnd p) a with_selected_changes_reversed :: (RepoPatch p) => WithPatches (PatchInfoAnd p) a with_selected_last_changes_to_files :: (RepoPatch p) => WithPatchesToFiles (PatchInfoAnd p) a with_selected_last_changes_to_files_reversed :: (RepoPatch p) => WithPatchesToFiles (PatchInfoAnd p) a with_selected_last_changes_reversed :: (RepoPatch p) => WithPatches (PatchInfoAnd p) a view_changes :: (RepoPatch p) => [DarcsFlag] -> FL (PatchInfoAnd p) -> IO () with_selected_patch_from_repo :: (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))) instance Eq WhichChanges instance Show WhichChanges 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) fileExists :: Slurpy -> SubPath -> IO Bool module Darcs.Commands.AmendRecord amendrecord :: DarcsCommand 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.Pull pull :: DarcsCommand module Darcs.Commands.Push push :: DarcsCommand module Darcs.Commands.Put put :: 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.Send send :: 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 showManifest :: DarcsCommand module Darcs.Commands.ShowTags showTags :: DarcsCommand module Darcs.Commands.ShowRepo showRepo :: DarcsCommand module Darcs.Commands.ShowIndex showIndex :: DarcsCommand showPristine :: DarcsCommand module Darcs.Commands.Show showCommand :: DarcsCommand list :: DarcsCommand query :: DarcsCommand module Darcs.Commands.Tag tag :: DarcsCommand module Darcs.Commands.TrackDown trackdown :: DarcsCommand module Darcs.Commands.TransferMode transferMode :: DarcsCommand module Darcs.Commands.WhatsNew whatsnew :: 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 get_default_flags :: String -> [DarcsOption] -> [DarcsFlag] -> IO [DarcsFlag] module Darcs.RunCommand run_the_command :: String -> [String] -> IO ()