diff options
author | Joey Hess <joey@kitenet.net> | 2013-11-18 17:24:18 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-11-18 17:24:18 -0400 |
commit | 72bd1369cd32320bb268b16b97032b1f11b33edc (patch) | |
tree | a3755b42a8a78da084d55d6292b15417f3debbb0 | |
parent | 8fd72896652925d9d85b4e2ff27b31a2a2af92af (diff) |
dropunused, addunused: Allow "all" instead of a range to act on all unused data.
-rw-r--r-- | Command/Unused.hs | 8 | ||||
-rw-r--r-- | debian/changelog | 7 | ||||
-rw-r--r-- | doc/git-annex.mdwn | 1 |
3 files changed, 13 insertions, 3 deletions
diff --git a/Command/Unused.hs b/Command/Unused.hs index 844cdb19b..1e5cdc163 100644 --- a/Command/Unused.hs +++ b/Command/Unused.hs @@ -332,11 +332,13 @@ withUnusedMaps a params = do unused <- readUnusedLog "" unusedbad <- readUnusedLog "bad" unusedtmp <- readUnusedLog "tmp" + let m = unused `M.union` unusedbad `M.union` unusedtmp return $ map (a $ UnusedMaps unused unusedbad unusedtmp) $ - concatMap unusedSpec params + concatMap (unusedSpec m) params -unusedSpec :: String -> [Int] -unusedSpec spec +unusedSpec :: UnusedMap -> String -> [Int] +unusedSpec m spec + | spec == "all" = [fst (M.findMin m)..fst (M.findMax m)] | "-" `isInfixOf` spec = range $ separate (== '-') spec | otherwise = maybe badspec (: []) (readish spec) where diff --git a/debian/changelog b/debian/changelog index 78767b7d5..6d8a3f72e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +git-annex (5.20131119) UNRELEASED; urgency=low + + * dropunused, addunused: Allow "all" instead of a range to + act on all unused data. + + -- Joey Hess <joeyh@debian.org> Mon, 18 Nov 2013 17:09:21 -0400 + git-annex (5.20131118) unstable; urgency=low * Direct mode repositories now have core.bare=true set, to prevent diff --git a/doc/git-annex.mdwn b/doc/git-annex.mdwn index 4cf29155b..15b8fd204 100644 --- a/doc/git-annex.mdwn +++ b/doc/git-annex.mdwn @@ -509,6 +509,7 @@ subdirectories). `git annex unused` You can also specify ranges of numbers, such as "1-1000". + Or, specify "all" to drop all unused data. To drop the data from a remote, specify `--from.` |