From d006586cd0b706c9cc92b2747b2ba3487f52c04a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 16 May 2011 13:27:19 -0400 Subject: add a message in potenatially confusing copy --fast failure situation --- Command/Move.hs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Command/Move.hs') diff --git a/Command/Move.hs b/Command/Move.hs index 623003e47..f49fe20e0 100644 --- a/Command/Move.hs +++ b/Command/Move.hs @@ -7,6 +7,8 @@ module Command.Move where +import Control.Monad (when) + import Command import qualified Command.Drop import qualified Annex @@ -84,7 +86,8 @@ toPerform dest move key = do -- and an explicit check is not done, when copying. When moving, -- it has to be done, to avoid inaverdent data loss. fast <- Annex.getState Annex.fast - isthere <- if fast && not move && not (Remote.hasKeyCheap dest) + let fastcheck = fast && not move && not (Remote.hasKeyCheap dest) + isthere <- if fastcheck then do (remotes, _) <- Remote.keyPossibilities key return $ Right $ dest `elem` remotes @@ -98,7 +101,10 @@ toPerform dest move key = do ok <- Remote.storeKey dest key if ok then next $ toCleanup dest move key - else stop -- failed + else do + when fastcheck $ + warning "This could have failed because --fast is enabled." + stop Right True -> next $ toCleanup dest move key toCleanup :: Remote.Remote Annex -> Bool -> Key -> CommandCleanup toCleanup dest move key = do -- cgit v1.2.3