From c1c5ff5626edbd4474b327dc8b8e66bd218b3e5e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 13 Mar 2014 19:06:26 -0400 Subject: clean up cleanup action enumeration --- Annex.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Annex.hs') diff --git a/Annex.hs b/Annex.hs index 4e3efd0d0..820c1d569 100644 --- a/Annex.hs +++ b/Annex.hs @@ -60,6 +60,7 @@ import Types.FileMatcher import Types.NumCopies import Types.LockPool import Types.MetaData +import Types.CleanupActions import qualified Utility.Matcher import qualified Data.Map as M import qualified Data.Set as S @@ -114,7 +115,7 @@ data AnnexState = AnnexState , flags :: M.Map String Bool , fields :: M.Map String String , modmeta :: [ModMeta] - , cleanup :: M.Map String (Annex ()) + , cleanup :: M.Map CleanupAction (Annex ()) , inodeschanged :: Maybe Bool , useragent :: Maybe String , errcounter :: Integer @@ -210,9 +211,9 @@ setField field value = changeState $ \s -> s { fields = M.insertWith' const field value $ fields s } {- Adds a cleanup action to perform. -} -addCleanup :: String -> Annex () -> Annex () -addCleanup uid a = changeState $ \s -> - s { cleanup = M.insertWith' const uid a $ cleanup s } +addCleanup :: CleanupAction -> Annex () -> Annex () +addCleanup k a = changeState $ \s -> + s { cleanup = M.insertWith' const k a $ cleanup s } {- Sets the type of output to emit. -} setOutput :: OutputType -> Annex () -- cgit v1.2.3