From 49b7f5918341c30140779ea1f376b4d9f81d8a30 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 15 Mar 2011 22:53:14 -0400 Subject: test suite passes again doesn't test remote functionality.. but that may be working too now --- Command/Move.hs | 4 +--- Remotes.hs | 6 ++---- doc/git-annex.mdwn | 5 ++++- test.hs | 8 ++++---- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Command/Move.hs b/Command/Move.hs index 1b1481308..2d6c973fe 100644 --- a/Command/Move.hs +++ b/Command/Move.hs @@ -20,7 +20,6 @@ import qualified Remotes import UUID import Messages import Utility -import Key command :: [Command] command = [Command "move" paramPath seek @@ -137,8 +136,7 @@ fromCleanup :: Git.Repo -> Bool -> Key -> CommandCleanup fromCleanup src True key = do ok <- Remotes.onRemote src (boolSystem, False) "dropkey" [ Params "--quiet --force" - , Param $ "--backend=" ++ keyBackendName key - , Param $ keyName key + , Param $ show key ] -- better safe than sorry: assume the src dropped the key -- even if it seemed to fail; the failure could have occurred diff --git a/Remotes.hs b/Remotes.hs index dd733e454..8b760ac95 100644 --- a/Remotes.hs +++ b/Remotes.hs @@ -27,7 +27,6 @@ import Data.List (intersect, sortBy) import Control.Monad (when, unless, filterM) import Types -import Key import qualified GitRepo as Git import qualified Annex import LocationLog @@ -154,7 +153,7 @@ inAnnex r key = if Git.repoIsUrl r checkremote = do showNote ("checking " ++ Git.repoDescribe r ++ "...") inannex <- onRemote r (boolSystem, False) "inannex" - [Param ("--backend=" ++ keyBackendName key), Param (keyName key)] + [Param (show key)] return $ Right inannex {- Cost Ordered list of remotes. -} @@ -273,8 +272,7 @@ rsyncParams :: Git.Repo -> Bool -> Key -> FilePath -> Annex [CommandParam] rsyncParams r sending key file = do Just (shellcmd, shellparams) <- git_annex_shell r (if sending then "sendkey" else "recvkey") - [ Param $ "--backend=" ++ keyBackendName key - , Param $ keyName key + [ Param $ show key -- Command is terminated with "--", because -- rsync will tack on its own options afterwards, -- and they need to be ignored. diff --git a/doc/git-annex.mdwn b/doc/git-annex.mdwn index bfec527d9..e559e8cba 100644 --- a/doc/git-annex.mdwn +++ b/doc/git-annex.mdwn @@ -296,7 +296,10 @@ Many git-annex commands will stage changes for later `git commit` by you. * --backend=name - Specifies which key-value backend to use. + Specifies which key-value backend to use. This can be used when + adding a file to the annex, or migrating a file. Once files + are in the annex, their backend is known and this option is not + necessary. * --key=name diff --git a/test.hs b/test.hs index 2bc0c37a3..49f7f2ab9 100644 --- a/test.hs +++ b/test.hs @@ -121,9 +121,9 @@ test_setkey :: Test test_setkey = "git-annex setkey/fromkey" ~: TestCase $ inmainrepo $ do writeFile tmp $ content sha1annexedfile r <- annexeval $ BackendClass.getKey backendSHA1 tmp - let sha1 = Key.keyName $ fromJust r - git_annex "setkey" ["-q", "--backend", "SHA1", "--key", sha1, tmp] @? "setkey failed" - git_annex "fromkey" ["-q", "--backend", "SHA1", "--key", sha1, sha1annexedfile] @? "fromkey failed" + let key = show $ fromJust r + git_annex "setkey" ["-q", "--key", key, tmp] @? "setkey failed" + git_annex "fromkey" ["-q", "--key", key, sha1annexedfile] @? "fromkey failed" Utility.boolSystem "git" [Utility.Params "commit -q -a -m commit"] @? "git commit failed" annexed_present sha1annexedfile where @@ -439,7 +439,7 @@ test_unused = "git-annex unused/dropunused" ~: intmpclonerepo $ do checkunused [annexedfilekey, sha1annexedfilekey] -- good opportunity to test dropkey also - git_annex "dropkey" ["-q", "--force", Key.keyName annexedfilekey] + git_annex "dropkey" ["-q", "--force", show annexedfilekey] @? "dropkey failed" checkunused [sha1annexedfilekey] -- cgit v1.2.3