From 5ff04bf2afcc62d1762adbc1c2a0374952328c0f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 15 Sep 2011 16:57:02 -0400 Subject: tweak --- Command/Add.hs | 5 +++-- Command/AddUrl.hs | 2 +- Command/Lock.hs | 3 ++- Command/Migrate.hs | 3 ++- Command/PreCommit.hs | 3 ++- 5 files changed, 10 insertions(+), 6 deletions(-) (limited to 'Command') 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 -- cgit v1.2.3