move LocationLog into Annex monad from IO

It will need to run in Annex so it can use Branch
This commit is contained in:
Joey Hess 2011-06-22 14:27:50 -04:00
parent 78a325b093
commit d3f0106f2e
9 changed files with 25 additions and 27 deletions

View file

@ -60,7 +60,7 @@ verifyLocationLog key file = do
preventWrite (parentDir f)
u <- getUUID g
uuids <- liftIO $ keyLocations g key
uuids <- keyLocations g key
case (present, u `elem` uuids) of
(True, False) -> do

View file

@ -68,7 +68,7 @@ checkRemoteUnused' r = do
showNote $ "checking for unused data..."
g <- Annex.gitRepo
referenced <- getKeysReferenced
logged <- liftIO $ loggedKeys g
logged <- loggedKeys g
remotehas <- filterM isthere logged
let remoteunused = remotehas `exclude` referenced
let list = number 0 remoteunused
@ -79,7 +79,7 @@ checkRemoteUnused' r = do
where
isthere k = do
g <- Annex.gitRepo
us <- liftIO $ keyLocations g k
us <- keyLocations g k
return $ uuid `elem` us
uuid = Remote.uuid r

View file

@ -7,8 +7,6 @@
module Command.Whereis where
import Control.Monad.State (liftIO)
import qualified Annex
import LocationLog
import Command
@ -31,7 +29,7 @@ start file = isAnnexed file $ \(key, _) -> do
perform :: Key -> CommandPerform
perform key = do
g <- Annex.gitRepo
uuids <- liftIO $ keyLocations g key
uuids <- keyLocations g key
let num = length uuids
showNote $ show num ++ " " ++ copiesplural num
if null $ uuids