diff options
author | Joey Hess <joey@kitenet.net> | 2011-03-16 12:52:30 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-03-16 12:52:30 -0400 |
commit | 1443fcfe022028c2c074fc555d1e0d595fd4db95 (patch) | |
tree | d5e54b4569213e9831523ed9d03e7e5cf75d6c83 /Upgrade | |
parent | e31eb441717c0cc4a4b690108c3ce858cae7c692 (diff) |
don't use queue when upgrading
In a large repo, just queuing the things to do used a lot of ram.
Diffstat (limited to 'Upgrade')
-rw-r--r-- | Upgrade/V1.hs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/Upgrade/V1.hs b/Upgrade/V1.hs index 797bdee0d..ffb774f7d 100644 --- a/Upgrade/V1.hs +++ b/Upgrade/V1.hs @@ -61,7 +61,6 @@ upgrade = do updateSymlinks moveLocationLogs - Annex.queueRun setVersion -- add new line to auto-merge hashed location logs @@ -89,17 +88,18 @@ updateSymlinks :: Annex () updateSymlinks = do g <- Annex.gitRepo files <- liftIO $ Git.inRepo g [Git.workTree g] - forM_ files $ fixlink + forM_ files $ (fixlink g) where - fixlink f = do + fixlink g f = do r <- lookupFile1 f case r of Nothing -> return () Just (k, _) -> do link <- calcGitLink f k - liftIO $ removeFile f - liftIO $ createSymbolicLink link f - Annex.queue "add" [Param "--"] f + liftIO $ do + removeFile f + createSymbolicLink link f + Git.run g "add" [Param "--", File f] moveLocationLogs :: Annex () moveLocationLogs = do @@ -123,10 +123,11 @@ moveLocationLogs = do -- logs that have been pulled from elsewhere old <- liftIO $ readLog f new <- liftIO $ readLog dest - liftIO $ writeLog dest (old++new) - Annex.queue "add" [Param "--"] dest - Annex.queue "add" [Param "--"] f - Annex.queue "rm" [Param "--quiet", Param "-f", Param "--"] f + liftIO $ do + writeLog dest (old++new) + Git.run g "add" [Param "--", File dest] + Git.run g "add" [Param "--", File f] + Git.run g "rm" [Param "--quiet", Param "-f", Param "--", File f] oldlog2key :: FilePath -> Maybe (FilePath, Key) oldlog2key l = |