summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-05-16 13:27:19 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-05-16 13:27:19 -0400
commitd006586cd0b706c9cc92b2747b2ba3487f52c04a (patch)
treeb66f3afd89a9374c63e1fa33824b840f26becfba /Command
parent0a7bcd47aeec9a2d1c9a42ef8d9ea539a6aef0d3 (diff)
add a message in potenatially confusing copy --fast failure situation
Diffstat (limited to 'Command')
-rw-r--r--Command/Move.hs10
1 files changed, 8 insertions, 2 deletions
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