diff options
author | Joey Hess <joey@kitenet.net> | 2011-03-29 17:57:20 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-03-29 17:57:20 -0400 |
commit | 0782d7006365e82c0040b25364fa452b0e00e527 (patch) | |
tree | df405b78e2551df52652083e7bb36a18241a1a23 /Remote.hs | |
parent | 72f94cc42eca1a6aaa7cc95daf423915761805ff (diff) |
copy --to S3 works
Diffstat (limited to 'Remote.hs')
-rw-r--r-- | Remote.hs | 24 |
1 files changed, 10 insertions, 14 deletions
@@ -59,11 +59,19 @@ genList = do rs <- Annex.getState Annex.remotes if null rs then do - l <- mapM generator remoteTypes - rs' <- getConfigs (concat l) + m <- readRemoteLog + l <- mapM (process m) remoteTypes + let rs' = concat l Annex.changeState $ \s -> s { Annex.remotes = rs' } return rs' else return rs + where + process m t = do + l <- enumerate t + mapM (gen m t) l + gen m t r = do + u <- getUUID r + generate t r (M.lookup u m) {- Looks up a remote by name. (Or by UUID.) -} byName :: String -> Annex (Remote Annex) @@ -122,18 +130,6 @@ remoteLog = do g <- Annex.gitRepo return $ gitStateDir g ++ "remote.log" -{- Load stored config into remotes. - - - - This way, the log is read once, lazily, so if no remotes access - - their config, no work is done. - -} -getConfigs :: [Remote Annex] -> Annex [Remote Annex] -getConfigs rs = do - m <- readRemoteLog - return $ map (get m) rs - where - get m r = r { config = M.lookup (uuid r) m } - {- Adds or updates a remote's config in the log. -} configSet :: UUID -> M.Map String String -> Annex () configSet u c = do |