diff --git a/Command/DropUnused.hs b/Command/DropUnused.hs index c6a28663ec..932a8b8635 100644 --- a/Command/DropUnused.hs +++ b/Command/DropUnused.hs @@ -27,12 +27,16 @@ command = [repoCommand "dropunused" (paramRepeating paramNumber) seek "drop unused file content"] seek :: [CommandSeek] -seek = [withStrings start] +seek = [withUnusedMap] -{- Drops unused content by number. -} -start :: CommandStartString -start s = notBareRepo $ do +{- Read unusedlog once, and pass the map to each start action. -} +withUnusedMap :: CommandSeek +withUnusedMap params = do m <- readUnusedLog + return $ map (start m) params + +start :: M.Map String Key -> CommandStartString +start m s = notBareRepo $ do case M.lookup s m of Nothing -> return Nothing Just key -> do diff --git a/debian/changelog b/debian/changelog index 7bb5bd8d21..9235c3ca33 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,6 +17,7 @@ git-annex (0.20110321) UNRELEASED; urgency=low * Fix space leak in fsck and drop commands. * migrate: Bugfix for case when migrating a file results in a key that is already present in .git/annex/objects. + * dropunused: Significantly sped up; only read unused log file once. -- Joey Hess Tue, 22 Mar 2011 16:52:00 -0400