test suite passes again

doesn't test remote functionality.. but that may be working too now
This commit is contained in:
Joey Hess 2011-03-15 22:53:14 -04:00
parent 9d24cc7bdb
commit 49b7f59183
4 changed files with 11 additions and 12 deletions

View file

@ -20,7 +20,6 @@ import qualified Remotes
import UUID import UUID
import Messages import Messages
import Utility import Utility
import Key
command :: [Command] command :: [Command]
command = [Command "move" paramPath seek command = [Command "move" paramPath seek
@ -137,8 +136,7 @@ fromCleanup :: Git.Repo -> Bool -> Key -> CommandCleanup
fromCleanup src True key = do fromCleanup src True key = do
ok <- Remotes.onRemote src (boolSystem, False) "dropkey" ok <- Remotes.onRemote src (boolSystem, False) "dropkey"
[ Params "--quiet --force" [ Params "--quiet --force"
, Param $ "--backend=" ++ keyBackendName key , Param $ show key
, Param $ keyName key
] ]
-- better safe than sorry: assume the src dropped the key -- better safe than sorry: assume the src dropped the key
-- even if it seemed to fail; the failure could have occurred -- even if it seemed to fail; the failure could have occurred

View file

@ -27,7 +27,6 @@ import Data.List (intersect, sortBy)
import Control.Monad (when, unless, filterM) import Control.Monad (when, unless, filterM)
import Types import Types
import Key
import qualified GitRepo as Git import qualified GitRepo as Git
import qualified Annex import qualified Annex
import LocationLog import LocationLog
@ -154,7 +153,7 @@ inAnnex r key = if Git.repoIsUrl r
checkremote = do checkremote = do
showNote ("checking " ++ Git.repoDescribe r ++ "...") showNote ("checking " ++ Git.repoDescribe r ++ "...")
inannex <- onRemote r (boolSystem, False) "inannex" inannex <- onRemote r (boolSystem, False) "inannex"
[Param ("--backend=" ++ keyBackendName key), Param (keyName key)] [Param (show key)]
return $ Right inannex return $ Right inannex
{- Cost Ordered list of remotes. -} {- Cost Ordered list of remotes. -}
@ -273,8 +272,7 @@ rsyncParams :: Git.Repo -> Bool -> Key -> FilePath -> Annex [CommandParam]
rsyncParams r sending key file = do rsyncParams r sending key file = do
Just (shellcmd, shellparams) <- git_annex_shell r Just (shellcmd, shellparams) <- git_annex_shell r
(if sending then "sendkey" else "recvkey") (if sending then "sendkey" else "recvkey")
[ Param $ "--backend=" ++ keyBackendName key [ Param $ show key
, Param $ keyName key
-- Command is terminated with "--", because -- Command is terminated with "--", because
-- rsync will tack on its own options afterwards, -- rsync will tack on its own options afterwards,
-- and they need to be ignored. -- and they need to be ignored.

View file

@ -296,7 +296,10 @@ Many git-annex commands will stage changes for later `git commit` by you.
* --backend=name * --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 * --key=name

View file

@ -121,9 +121,9 @@ test_setkey :: Test
test_setkey = "git-annex setkey/fromkey" ~: TestCase $ inmainrepo $ do test_setkey = "git-annex setkey/fromkey" ~: TestCase $ inmainrepo $ do
writeFile tmp $ content sha1annexedfile writeFile tmp $ content sha1annexedfile
r <- annexeval $ BackendClass.getKey backendSHA1 tmp r <- annexeval $ BackendClass.getKey backendSHA1 tmp
let sha1 = Key.keyName $ fromJust r let key = show $ fromJust r
git_annex "setkey" ["-q", "--backend", "SHA1", "--key", sha1, tmp] @? "setkey failed" git_annex "setkey" ["-q", "--key", key, tmp] @? "setkey failed"
git_annex "fromkey" ["-q", "--backend", "SHA1", "--key", sha1, sha1annexedfile] @? "fromkey failed" git_annex "fromkey" ["-q", "--key", key, sha1annexedfile] @? "fromkey failed"
Utility.boolSystem "git" [Utility.Params "commit -q -a -m commit"] @? "git commit failed" Utility.boolSystem "git" [Utility.Params "commit -q -a -m commit"] @? "git commit failed"
annexed_present sha1annexedfile annexed_present sha1annexedfile
where where
@ -439,7 +439,7 @@ test_unused = "git-annex unused/dropunused" ~: intmpclonerepo $ do
checkunused [annexedfilekey, sha1annexedfilekey] checkunused [annexedfilekey, sha1annexedfilekey]
-- good opportunity to test dropkey also -- good opportunity to test dropkey also
git_annex "dropkey" ["-q", "--force", Key.keyName annexedfilekey] git_annex "dropkey" ["-q", "--force", show annexedfilekey]
@? "dropkey failed" @? "dropkey failed"
checkunused [sha1annexedfilekey] checkunused [sha1annexedfilekey]