git-annex/Assistant/Drop.hs

27 lines
811 B
Haskell
Raw Normal View History

2012-10-18 19:22:28 +00:00
{- git-annex assistant dropping of unwanted content
-
- Copyright 2012 Joey Hess <id@joeyh.name>
2012-10-18 19:22:28 +00:00
-
- Licensed under the GNU AGPL version 3 or higher.
2012-10-18 19:22:28 +00:00
-}
module Assistant.Drop (
handleDrops,
handleDropsFrom,
) where
2012-10-18 19:22:28 +00:00
import Assistant.Common
import Assistant.DaemonStatus
import Annex.Drop (handleDropsFrom, Reason)
2012-10-18 19:22:28 +00:00
import Logs.Location
import CmdLine.Action
import Types.NumCopies
2012-10-18 20:05:43 +00:00
{- Drop from local and/or remote when allowed by the preferred content and
2012-12-05 16:32:26 +00:00
- numcopies settings. -}
handleDrops :: Reason -> Bool -> Key -> AssociatedFile -> [VerifiedCopy] -> Assistant ()
handleDrops reason fromhere key f preverified = do
syncrs <- syncDataRemotes <$> getDaemonStatus
locs <- liftAnnex $ loggedLocations key
liftAnnex $ handleDropsFrom locs syncrs reason fromhere key f preverified callCommandAction