fromkey --force: Skip test that the key has its content in the annex.
This commit is contained in:
parent
48e987a71f
commit
fa180c1ba1
3 changed files with 15 additions and 7 deletions
|
@ -12,6 +12,7 @@ import Command
|
||||||
import qualified Annex.Queue
|
import qualified Annex.Queue
|
||||||
import Annex.Content
|
import Annex.Content
|
||||||
import Types.Key
|
import Types.Key
|
||||||
|
import qualified Annex
|
||||||
|
|
||||||
cmd :: [Command]
|
cmd :: [Command]
|
||||||
cmd = [notDirect $ notBareRepo $
|
cmd = [notDirect $ notBareRepo $
|
||||||
|
@ -19,17 +20,20 @@ cmd = [notDirect $ notBareRepo $
|
||||||
SectionPlumbing "adds a file using a specific key"]
|
SectionPlumbing "adds a file using a specific key"]
|
||||||
|
|
||||||
seek :: CommandSeek
|
seek :: CommandSeek
|
||||||
seek = withWords start
|
seek ps = do
|
||||||
|
force <- Annex.getState Annex.force
|
||||||
|
withWords (start force) ps
|
||||||
|
|
||||||
start :: [String] -> CommandStart
|
start :: Bool -> [String] -> CommandStart
|
||||||
start (keyname:file:[]) = do
|
start force (keyname:file:[]) = do
|
||||||
let key = fromMaybe (error "bad key") $ file2key keyname
|
let key = fromMaybe (error "bad key") $ file2key keyname
|
||||||
inbackend <- inAnnex key
|
unless force $ do
|
||||||
unless inbackend $ error $
|
inbackend <- inAnnex key
|
||||||
"key ("++ keyname ++") is not present in backend"
|
unless inbackend $ error $
|
||||||
|
"key ("++ keyname ++") is not present in backend (use --force to override this sanity check)"
|
||||||
showStart "fromkey" file
|
showStart "fromkey" file
|
||||||
next $ perform key file
|
next $ perform key file
|
||||||
start _ = error "specify a key and a dest file"
|
start _ _ = error "specify a key and a dest file"
|
||||||
|
|
||||||
perform :: Key -> FilePath -> CommandPerform
|
perform :: Key -> FilePath -> CommandPerform
|
||||||
perform key file = do
|
perform key file = do
|
||||||
|
|
1
debian/changelog
vendored
1
debian/changelog
vendored
|
@ -35,6 +35,7 @@ git-annex (5.2015022) UNRELEASED; urgency=medium
|
||||||
bittorrent etc urls.
|
bittorrent etc urls.
|
||||||
* git-annex-shell: Improve error message when the specified repository
|
* git-annex-shell: Improve error message when the specified repository
|
||||||
doesn't exist or git config fails for some reason.
|
doesn't exist or git config fails for some reason.
|
||||||
|
* fromkey --force: Skip test that the key has its content in the annex.
|
||||||
|
|
||||||
-- Joey Hess <id@joeyh.name> Thu, 19 Feb 2015 14:16:03 -0400
|
-- Joey Hess <id@joeyh.name> Thu, 19 Feb 2015 14:16:03 -0400
|
||||||
|
|
||||||
|
|
|
@ -957,6 +957,9 @@ subdirectories).
|
||||||
This plumbing-level command can be used to manually set up a file
|
This plumbing-level command can be used to manually set up a file
|
||||||
in the git repository to link to a specified key.
|
in the git repository to link to a specified key.
|
||||||
|
|
||||||
|
Normally, the annex needs to already contain the content object for the
|
||||||
|
key. To override this, use --force.
|
||||||
|
|
||||||
* `dropkey [key ...]`
|
* `dropkey [key ...]`
|
||||||
|
|
||||||
This plumbing-level command drops the annexed data for the specified
|
This plumbing-level command drops the annexed data for the specified
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue