changelog and minor cleanup to fix mixed spaces/tabs

This commit is contained in:
Joey Hess 2012-09-23 15:42:05 -04:00
parent 0732d4c8ef
commit d77ff5dadd
3 changed files with 13 additions and 10 deletions

View file

@ -85,20 +85,20 @@ addIn name = addLimit $ check $ if name == "." then inAnnex else inremote
- of copies. -} - of copies. -}
addCopies :: String -> Annex () addCopies :: String -> Annex ()
addCopies trust_num = addLimit . check $ readnum num addCopies trust_num = addLimit . check $ readnum num
where (num, mayCheckTrust) = where
case split ":" trust_num of (num, mayCheckTrust) = case split ":" trust_num of
[trust, num'] -> (num', checkTrust (readtrust trust)) [trust, num'] -> (num', checkTrust (readtrust trust))
[num'] -> (num', const (return True)) [num'] -> (num', const (return True))
_ -> bad _ -> bad
readnum = maybe bad id . readish readnum = maybe bad id . readish
readtrust = maybe bad id . readTrust readtrust = maybe bad id . readTrust
check n = Backend.lookupFile >=> handle n check n = Backend.lookupFile >=> handle n
handle _ Nothing = return False handle _ Nothing = return False
handle n (Just (key, _)) = do handle n (Just (key, _)) = do
us <- filterM mayCheckTrust =<< Remote.keyLocations key us <- filterM mayCheckTrust =<< Remote.keyLocations key
return $ length us >= n return $ length us >= n
checkTrust t u = (== t) <$> lookupTrust u -- == or >= checkTrust t u = (== t) <$> lookupTrust u
bad = error "bad number or trust:number for --copies" bad = error "bad number or trust:number for --copies"
{- Adds a limit to skip files not using a specified key-value backend. -} {- Adds a limit to skip files not using a specified key-value backend. -}
addInBackend :: String -> Annex () addInBackend :: String -> Annex ()

View file

@ -89,7 +89,7 @@ readTrust :: String -> Maybe TrustLevel
readTrust "trusted" = Just Trusted readTrust "trusted" = Just Trusted
readTrust "untrusted" = Just UnTrusted readTrust "untrusted" = Just UnTrusted
readTrust "semitrusted" = Just SemiTrusted readTrust "semitrusted" = Just SemiTrusted
readTrust "dead" = Just DeadTrusted -- NEW CASE readTrust "dead" = Just DeadTrusted
readTrust _ = Nothing readTrust _ = Nothing
{- The trust.log used to only list trusted repos, without a field for the {- The trust.log used to only list trusted repos, without a field for the

3
debian/changelog vendored
View file

@ -23,6 +23,9 @@ git-annex (3.20120826) UNRELEASED; urgency=low
files and reading from checksum commands. files and reading from checksum commands.
* sync: Pushes the git-annex branch to remote/synced/git-annex, rather * sync: Pushes the git-annex branch to remote/synced/git-annex, rather
than directly to remote/git-annex. than directly to remote/git-annex.
* Now supports matchig files that are present on a number of remotes
with a speficied trust level. Example: --copies=trusted:2
Thanks, Nicolas Pouillard
-- Joey Hess <joeyh@debian.org> Mon, 27 Aug 2012 13:27:39 -0400 -- Joey Hess <joeyh@debian.org> Mon, 27 Aug 2012 13:27:39 -0400