git-annex/Assistant/Drop.hs

26 lines
799 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 GPL version 3 or higher.
-}
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
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 -> Maybe Remote -> Assistant ()
handleDrops reason fromhere key f knownpresentremote = do
syncrs <- syncDataRemotes <$> getDaemonStatus
locs <- liftAnnex $ loggedLocations key
liftAnnex $ handleDropsFrom locs syncrs reason fromhere key f knownpresentremote callCommandAction