summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-01-22 15:33:02 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-01-22 15:33:02 -0400
commitcc366b8241cfc3e41252ecd2624332c15da03377 (patch)
tree78d254a03b1298ff3ae9c8c77dad04b049ce1871 /Command
parentf78a0a2b11591aca0885213e0b74cddff4d6ae57 (diff)
add timestamps to unused log files
This will be used in expiring old unused objects. The timestamp is when it was first noticed it was unused. Backwards compatability: It supports reading old format unused log files. The old version of git-annex will ignore lines in log files written by the new version, so the worst interop problem would be git annex dropunused not knowing some numbers that git-annex unused reported.
Diffstat (limited to 'Command')
-rw-r--r--Command/Unused.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Command/Unused.hs b/Command/Unused.hs
index 19dc82007..59c5ec1aa 100644
--- a/Command/Unused.hs
+++ b/Command/Unused.hs
@@ -92,7 +92,7 @@ check file msg a c = do
l <- a
let unusedlist = number c l
unless (null l) $ showLongNote $ msg unusedlist
- writeUnusedLog file unusedlist
+ updateUnusedLog file $ M.fromList unusedlist
return $ c + length l
number :: Int -> [a] -> [(Int, a)]
@@ -328,9 +328,9 @@ data UnusedMaps = UnusedMaps
withUnusedMaps :: (UnusedMaps -> Int -> CommandStart) -> CommandSeek
withUnusedMaps a params = do
- unused <- readUnusedLog ""
- unusedbad <- readUnusedLog "bad"
- unusedtmp <- readUnusedLog "tmp"
+ unused <- readUnusedMap ""
+ unusedbad <- readUnusedMap "bad"
+ unusedtmp <- readUnusedMap "tmp"
let m = unused `M.union` unusedbad `M.union` unusedtmp
let unusedmaps = UnusedMaps unused unusedbad unusedtmp
seekActions $ return $ map (a unusedmaps) $