don't use queue when upgrading

In a large repo, just queuing the things to do used a lot of ram.
This commit is contained in:
Joey Hess 2011-03-16 12:52:30 -04:00
parent e31eb44171
commit 1443fcfe02

View file

@ -61,7 +61,6 @@ upgrade = do
updateSymlinks updateSymlinks
moveLocationLogs moveLocationLogs
Annex.queueRun
setVersion setVersion
-- add new line to auto-merge hashed location logs -- add new line to auto-merge hashed location logs
@ -89,17 +88,18 @@ updateSymlinks :: Annex ()
updateSymlinks = do updateSymlinks = do
g <- Annex.gitRepo g <- Annex.gitRepo
files <- liftIO $ Git.inRepo g [Git.workTree g] files <- liftIO $ Git.inRepo g [Git.workTree g]
forM_ files $ fixlink forM_ files $ (fixlink g)
where where
fixlink f = do fixlink g f = do
r <- lookupFile1 f r <- lookupFile1 f
case r of case r of
Nothing -> return () Nothing -> return ()
Just (k, _) -> do Just (k, _) -> do
link <- calcGitLink f k link <- calcGitLink f k
liftIO $ removeFile f liftIO $ do
liftIO $ createSymbolicLink link f removeFile f
Annex.queue "add" [Param "--"] f createSymbolicLink link f
Git.run g "add" [Param "--", File f]
moveLocationLogs :: Annex () moveLocationLogs :: Annex ()
moveLocationLogs = do moveLocationLogs = do
@ -123,10 +123,11 @@ moveLocationLogs = do
-- logs that have been pulled from elsewhere -- logs that have been pulled from elsewhere
old <- liftIO $ readLog f old <- liftIO $ readLog f
new <- liftIO $ readLog dest new <- liftIO $ readLog dest
liftIO $ writeLog dest (old++new) liftIO $ do
Annex.queue "add" [Param "--"] dest writeLog dest (old++new)
Annex.queue "add" [Param "--"] f Git.run g "add" [Param "--", File dest]
Annex.queue "rm" [Param "--quiet", Param "-f", Param "--"] f Git.run g "add" [Param "--", File f]
Git.run g "rm" [Param "--quiet", Param "-f", Param "--", File f]
oldlog2key :: FilePath -> Maybe (FilePath, Key) oldlog2key :: FilePath -> Maybe (FilePath, Key)
oldlog2key l = oldlog2key l =