module Text.ChangeMonger.Darcs (darcsChanges, darcsChangesAll, darcsChangesSince) where

import Text.ChangeMonger.Parse (run)

-- | Ask Darcs for changes in general; we accept an options argument which
-- will be passed onto Darcs, so you can customize by using any of the many
-- options to 'changes' which Darcs understands.
darcsChanges :: String -> IO String
darcsChanges a = run "darcs" ["changes", a]

-- | Nothing fancy: just get the entire repository history.
darcsChangesAll :: IO String
darcsChangesAll = darcsChanges ""

-- | Ask Darcs for all changes, since the last tag. Conscientious folks
-- tag at every release, so this is a good heuristic.
darcsChangesSince :: IO String
darcsChangesSince = darcsChanges "--from-tag=."