get associated files from Keys database

This commit is contained in:
Joey Hess 2015-12-26 15:09:53 -04:00
parent 7593917147
commit 54f87ef95f
Failed to extract signature

View file

@ -18,6 +18,7 @@ import Command
import Annex.Wanted import Annex.Wanted
import Config import Config
import Annex.Content.Direct import Annex.Content.Direct
import qualified Database.Keys
import qualified Data.Set as S import qualified Data.Set as S
import System.Log.Logger (debugM) import System.Log.Logger (debugM)
@ -46,14 +47,11 @@ type Reason = String
-} -}
handleDropsFrom :: [UUID] -> [Remote] -> Reason -> Bool -> Key -> AssociatedFile -> [VerifiedCopy] -> (CommandStart -> CommandCleanup) -> Annex () handleDropsFrom :: [UUID] -> [Remote] -> Reason -> Bool -> Key -> AssociatedFile -> [VerifiedCopy] -> (CommandStart -> CommandCleanup) -> Annex ()
handleDropsFrom locs rs reason fromhere key afile preverified runner = do handleDropsFrom locs rs reason fromhere key afile preverified runner = do
fs <- ifM isDirect l <- ifM isDirect
( do ( associatedFilesRelative key
l <- associatedFilesRelative key , Database.Keys.getAssociatedFiles key
return $ if null l
then maybeToList afile
else l
, return $ maybeToList afile
) )
let fs = if null l then maybeToList afile else l
n <- getcopies fs n <- getcopies fs
void $ if fromhere && checkcopies n Nothing void $ if fromhere && checkcopies n Nothing
then go fs rs n >>= dropl fs then go fs rs n >>= dropl fs