From e47d1fd43e2433966b7baa6fc179ec6b70774214 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 15 Sep 2011 15:33:20 -0400 Subject: add error for move --auto It probably does not make sense to enable auto mode for move. I cannot think of a situation where it would make sense to try to use it. A hypothetical auto mode for move would only differ from a normal move in one case -- when both repositories have a file, move deletes it from one, and this reduces the number of copies. So an auto mode would either only let move work in that situation, or avoid removing the file in that situation, depending on the number of copies. This would be complex to implement, and is perhaps not a very obvious behavior. The error is a good thing to have, so users don't expect it to do something it does not. --- Command/Move.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Command') diff --git a/Command/Move.hs b/Command/Move.hs index 88da92f0a..f4310a2b8 100644 --- a/Command/Move.hs +++ b/Command/Move.hs @@ -18,6 +18,7 @@ import Content import qualified Remote import UUID import Messages +import Utility.Conditional command :: [Command] command = [repoCommand "move" paramPaths seek @@ -32,6 +33,7 @@ seek = [withFilesInGit $ start True] - moving data in the key-value backend. -} start :: Bool -> CommandStartString start move file = do + noAuto to <- Annex.getState Annex.toremote from <- Annex.getState Annex.fromremote case (from, to) of @@ -43,6 +45,9 @@ start move file = do src <- Remote.byName name fromStart src move file (_ , _) -> error "only one of --from or --to can be specified" + where + noAuto = when move $ whenM (Annex.getState Annex.auto) $ error + "--auto is not supported for move" showMoveAction :: Bool -> FilePath -> Annex () showMoveAction True file = showStart "move" file -- cgit v1.2.3