diff --git a/Command/SetContent.hs b/Command/Reinject.hs similarity index 90% rename from Command/SetContent.hs rename to Command/Reinject.hs index b63cc9119a..63309aa522 100644 --- a/Command/SetContent.hs +++ b/Command/Reinject.hs @@ -5,7 +5,7 @@ - Licensed under the GNU GPL version 3 or higher. -} -module Command.SetContent where +module Command.Reinject where import Common.Annex import Command @@ -14,7 +14,7 @@ import Annex.Content import qualified Command.Fsck def :: [Command] -def = [command "setcontent" (paramPair paramPath paramPath) seek +def = [command "reinject" (paramPair paramPath paramPath) seek "sets content of annexed file"] seek :: [CommandSeek] @@ -22,7 +22,7 @@ seek = [withWords start] start :: [FilePath] -> CommandStart start (src:dest:[]) = do - showStart "setcontent" dest + showStart "reinject" dest next $ perform src dest start _ = error "specify a src file and a dest file" diff --git a/GitAnnex.hs b/GitAnnex.hs index 09f0a118c0..399b26ef7f 100644 --- a/GitAnnex.hs +++ b/GitAnnex.hs @@ -26,7 +26,7 @@ import qualified Command.Copy import qualified Command.Get import qualified Command.FromKey import qualified Command.DropKey -import qualified Command.SetContent +import qualified Command.Reinject import qualified Command.Fix import qualified Command.Init import qualified Command.Describe @@ -63,7 +63,7 @@ cmds = concat , Command.Init.def , Command.Describe.def , Command.InitRemote.def - , Command.SetContent.def + , Command.Reinject.def , Command.Unannex.def , Command.Uninit.def , Command.PreCommit.def diff --git a/debian/changelog b/debian/changelog index 25f18f7950..dc6e3c38aa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,7 +13,7 @@ git-annex (3.20111026) UNRELEASED; urgency=low .gitattributes information about numcopies is not available in a bare repository. * unused, dropunused: Now work in bare repositories. - * Removed the setkey command, and added a setcontent command with a more + * Removed the setkey command, and added a reinject command with a more useful interface. * The fromkey command now takes the key as its first parameter. The --key option is no longer used. diff --git a/doc/bugs/No_easy_way_to_re-inject_a_file_into_an_annex/comment_4_480a4f72445a636eab1b1c0f816d365c._comment b/doc/bugs/No_easy_way_to_re-inject_a_file_into_an_annex/comment_4_480a4f72445a636eab1b1c0f816d365c._comment index 787173b0a6..fcca0561d4 100644 --- a/doc/bugs/No_easy_way_to_re-inject_a_file_into_an_annex/comment_4_480a4f72445a636eab1b1c0f816d365c._comment +++ b/doc/bugs/No_easy_way_to_re-inject_a_file_into_an_annex/comment_4_480a4f72445a636eab1b1c0f816d365c._comment @@ -4,6 +4,5 @@ subject="comment 4" date="2011-05-14T16:29:35Z" content=""" -Although, if you really do want to shoot yourself in the foot, or know you -have the old content, you can use `git-annex setcontent`. +Now available as `git-annex reinject`. """]] diff --git a/doc/git-annex.mdwn b/doc/git-annex.mdwn index 42997e5342..fdd8dd1c19 100644 --- a/doc/git-annex.mdwn +++ b/doc/git-annex.mdwn @@ -274,19 +274,18 @@ subdirectories). However, if a backend changes the information it uses to construct a key, this can also be used to migrate files to use the new key format. -* setcontent src dest +* reinject src dest - Makes the dest file, which must already be tracked by git-annex have the - content of the src file. The src file is removed. This can be useful if you - have obtained the content of a file from elsewhere and want to put it in - the local annex. + Moves the src file into the annex as the content of the dest file. + This can be useful if you have obtained the content of a file from + elsewhere and want to put it in the local annex. Automatically runs fsck on dest to check that the expected content was provided. Example: - git annex setcontent /tmp/foo.iso foo.iso + git annex reinject /tmp/foo.iso foo.iso * unannex [path ...] diff --git a/test.hs b/test.hs index fa7657b581..d466d3ad32 100644 --- a/test.hs +++ b/test.hs @@ -88,7 +88,7 @@ blackbox = TestLabel "blackbox" $ TestList -- test order matters, later tests may rely on state from earlier [ test_init , test_add - , test_setcontent + , test_reinject , test_unannex , test_drop , test_get @@ -140,13 +140,13 @@ test_add = "git-annex add" ~: TestList [basic, sha1dup, subdirs] changeWorkingDirectory "dir" git_annex "add" ["-q", "../dir2"] @? "add of ../subdir failed" -test_setcontent :: Test -test_setcontent = "git-annex setcontent/fromkey" ~: TestCase $ intmpclonerepo $ do +test_reinject :: Test +test_reinject = "git-annex reinject/fromkey" ~: TestCase $ intmpclonerepo $ do git_annex "drop" ["-q", "--force", sha1annexedfile] @? "drop failed" writeFile tmp $ content sha1annexedfile r <- annexeval $ Types.Backend.getKey backendSHA1 tmp let key = show $ fromJust r - git_annex "setcontent" ["-q", tmp, sha1annexedfile] @? "setcontent failed" + git_annex "reinject" ["-q", tmp, sha1annexedfile] @? "reinject failed" git_annex "fromkey" ["-q", key, sha1annexedfiledup] @? "fromkey failed" annexed_present sha1annexedfiledup where