diff options
author | Joey Hess <joey@kitenet.net> | 2011-09-15 16:57:02 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-09-15 16:59:52 -0400 |
commit | 5ff04bf2afcc62d1762adbc1c2a0374952328c0f (patch) | |
tree | a2d6bfac942582573d71ffe394f1c867688f8024 /Command | |
parent | 35145202d2e463569989b710ab5b87f6d9a8fdc1 (diff) |
tweak
Diffstat (limited to 'Command')
-rw-r--r-- | Command/Add.hs | 5 | ||||
-rw-r--r-- | Command/AddUrl.hs | 2 | ||||
-rw-r--r-- | Command/Lock.hs | 3 | ||||
-rw-r--r-- | Command/Migrate.hs | 3 | ||||
-rw-r--r-- | Command/PreCommit.hs | 3 |
5 files changed, 10 insertions, 6 deletions
diff --git a/Command/Add.hs b/Command/Add.hs index c6ab4d0ad..4b2ef24cd 100644 --- a/Command/Add.hs +++ b/Command/Add.hs @@ -27,6 +27,7 @@ import Utility.Conditional import Utility.Touch import Utility.SafeCommand import Locations +import Backend command :: [Command] command = [repoCommand "add" paramPaths seek "add files to annex"] @@ -39,7 +40,7 @@ seek = [withFilesNotInGit start, withFilesUnlocked start] - moving it into the annex directory and setting up the symlink pointing - to its content. -} start :: BackendFile -> CommandStart -start p@(file, _) = notAnnexed file $ do +start p@(_, file) = notAnnexed file $ do s <- liftIO $ getSymbolicLinkStatus file if isSymbolicLink s || not (isRegularFile s) then stop @@ -48,7 +49,7 @@ start p@(file, _) = notAnnexed file $ do next $ perform p perform :: BackendFile -> CommandPerform -perform (file, backend) = do +perform (backend, file) = do k <- Backend.genKey file backend case k of Nothing -> stop diff --git a/Command/AddUrl.hs b/Command/AddUrl.hs index 1fae358b2..d9fcc17e2 100644 --- a/Command/AddUrl.hs +++ b/Command/AddUrl.hs @@ -59,7 +59,7 @@ download url file = do ok <- Url.download url tmp if ok then do - [(_, backend)] <- Backend.chooseBackends [file] + [(backend, _)] <- Backend.chooseBackends [file] k <- Backend.genKey tmp backend case k of Nothing -> stop diff --git a/Command/Lock.hs b/Command/Lock.hs index 1c9a747f4..04d1bb94d 100644 --- a/Command/Lock.hs +++ b/Command/Lock.hs @@ -14,6 +14,7 @@ import Command import Messages import qualified AnnexQueue import Utility.SafeCommand +import Backend command :: [Command] command = [repoCommand "lock" paramPaths seek "undo unlock command"] @@ -23,7 +24,7 @@ seek = [withFilesUnlocked start, withFilesUnlockedToBeCommitted start] {- Undo unlock -} start :: BackendFile -> CommandStart -start (file, _) = do +start (_, file) = do showStart "lock" file next $ perform file diff --git a/Command/Migrate.hs b/Command/Migrate.hs index 69fe61e1d..2be910851 100644 --- a/Command/Migrate.hs +++ b/Command/Migrate.hs @@ -23,6 +23,7 @@ import Content import Messages import Utility.Conditional import qualified Command.Add +import Backend command :: [Command] command = [repoCommand "migrate" paramPaths seek @@ -32,7 +33,7 @@ seek :: [CommandSeek] seek = [withBackendFilesInGit start] start :: BackendFile -> CommandStart -start (file, b) = isAnnexed file $ \(key, oldbackend) -> do +start (b, file) = isAnnexed file $ \(key, oldbackend) -> do exists <- inAnnex key newbackend <- choosebackend b if (newbackend /= oldbackend || upgradableKey key) && exists diff --git a/Command/PreCommit.hs b/Command/PreCommit.hs index bcc1c943e..b6323e2b7 100644 --- a/Command/PreCommit.hs +++ b/Command/PreCommit.hs @@ -10,6 +10,7 @@ module Command.PreCommit where import Command import qualified Command.Add import qualified Command.Fix +import Backend command :: [Command] command = [repoCommand "pre-commit" paramPaths seek "run by git pre-commit hook"] @@ -24,7 +25,7 @@ start :: BackendFile -> CommandStart start p = next $ perform p perform :: BackendFile -> CommandPerform -perform pair@(file, _) = do +perform pair@(_, file) = do ok <- doCommand $ Command.Add.start pair if ok then next $ return True |