aboutsummaryrefslogtreecommitdiff
path: root/Command.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-01-21 16:08:19 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-01-21 16:08:59 -0400
commitd5f7fb27aad3e2e9c4bebb9ccd5577af8deb25c7 (patch)
tree838837e3112942fcf0f82cfc7f68e62a6f4e7a6e /Command.hs
parent9a8709f064c7608859b3155a752093b29cd8ab98 (diff)
reorganize numcopies code (no behavior changes)
Move stuff into Logs.NumCopies. Add a NumCopies newtype. Better names for various serialization classes that are specific to one thing or another.
Diffstat (limited to 'Command.hs')
-rw-r--r--Command.hs21
1 files changed, 0 insertions, 21 deletions
diff --git a/Command.hs b/Command.hs
index e3f748dc5..1943fc06e 100644
--- a/Command.hs
+++ b/Command.hs
@@ -19,8 +19,6 @@ module Command (
whenAnnexed,
ifAnnexed,
isBareRepo,
- numCopies,
- numCopiesCheck,
checkAuto,
module ReExported
) where
@@ -29,17 +27,12 @@ import Common.Annex
import qualified Backend
import qualified Annex
import qualified Git
-import qualified Remote
import Types.Command as ReExported
import Types.Option as ReExported
import Seek as ReExported
import Checks as ReExported
import Usage as ReExported
import RunCommand as ReExported
-import Logs.Trust
-import Logs.NumCopies
-import Config
-import Annex.CheckAttr
{- Generates a normal command -}
command :: String -> String -> CommandSeek -> CommandSection -> String -> Command
@@ -87,20 +80,6 @@ ifAnnexed file yes no = maybe no yes =<< Backend.lookupFile file
isBareRepo :: Annex Bool
isBareRepo = fromRepo Git.repoIsLocalBare
-numCopies :: FilePath -> Annex (Maybe Int)
-numCopies file = do
- global <- getGlobalNumCopies
- case global of
- Just n -> return $ Just n
- Nothing -> readish <$> checkAttr "annex.numcopies" file
-
-numCopiesCheck :: FilePath -> Key -> (Int -> Int -> v) -> Annex v
-numCopiesCheck file key vs = do
- numcopiesattr <- numCopies file
- needed <- getNumCopies numcopiesattr
- have <- trustExclude UnTrusted =<< Remote.keyLocations key
- return $ length have `vs` needed
-
checkAuto :: Annex Bool -> Annex Bool
checkAuto checker = ifM (Annex.getState Annex.auto)
( checker , return True )