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 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

View file

@ -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.

View file

@ -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

View file

@ -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]