dropunused: Significantly sped up; only read unused log file once.
This commit is contained in:
parent
6246b807f7
commit
03fdd0d56e
2 changed files with 9 additions and 4 deletions
|
@ -27,12 +27,16 @@ command = [repoCommand "dropunused" (paramRepeating paramNumber) seek
|
||||||
"drop unused file content"]
|
"drop unused file content"]
|
||||||
|
|
||||||
seek :: [CommandSeek]
|
seek :: [CommandSeek]
|
||||||
seek = [withStrings start]
|
seek = [withUnusedMap]
|
||||||
|
|
||||||
{- Drops unused content by number. -}
|
{- Read unusedlog once, and pass the map to each start action. -}
|
||||||
start :: CommandStartString
|
withUnusedMap :: CommandSeek
|
||||||
start s = notBareRepo $ do
|
withUnusedMap params = do
|
||||||
m <- readUnusedLog
|
m <- readUnusedLog
|
||||||
|
return $ map (start m) params
|
||||||
|
|
||||||
|
start :: M.Map String Key -> CommandStartString
|
||||||
|
start m s = notBareRepo $ do
|
||||||
case M.lookup s m of
|
case M.lookup s m of
|
||||||
Nothing -> return Nothing
|
Nothing -> return Nothing
|
||||||
Just key -> do
|
Just key -> do
|
||||||
|
|
1
debian/changelog
vendored
1
debian/changelog
vendored
|
@ -17,6 +17,7 @@ git-annex (0.20110321) UNRELEASED; urgency=low
|
||||||
* Fix space leak in fsck and drop commands.
|
* Fix space leak in fsck and drop commands.
|
||||||
* migrate: Bugfix for case when migrating a file results in a key that
|
* migrate: Bugfix for case when migrating a file results in a key that
|
||||||
is already present in .git/annex/objects.
|
is already present in .git/annex/objects.
|
||||||
|
* dropunused: Significantly sped up; only read unused log file once.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Tue, 22 Mar 2011 16:52:00 -0400
|
-- Joey Hess <joeyh@debian.org> Tue, 22 Mar 2011 16:52:00 -0400
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue