module Text.ChangeMonger.Subversion (svnChanges, svnChangesAll) where

import Text.ChangeMonger.Parse (run)

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

-- | Nothing fancy: just get the entire repository history.
-- Unfortunately, Subversion doesn't have a very useful notion of
-- tags, so we merely get the full history.
svnChangesAll :: IO String
svnChangesAll = svnChanges ""

{- TODO: add support for what tagging there is. See
 <http://svnbook.red-bean.com/en/1.4/svn.branchmerge.tags.html>.
 It'd look something like foo="svn log | grep -C 2 tag | head -n | cut -d 1,2-";
 "svn log -rfoo-HEAD"
 someone on #svn suggested doing something like 'svn log --stop-on-copy
 http://svn.yourhost.com/reposname/tags/tagname" -}

-- svnChangesSince :: IO String
-- svnChangesSince = undefined