drop: Suggest using git annex move when numcopies prevents dropping a file.
This commit is contained in:
parent
1bc49b7158
commit
2e11a6013b
5 changed files with 14 additions and 5 deletions
|
@ -133,6 +133,7 @@ notEnoughCopies key need have skip bad = do
|
||||||
" necessary copies"
|
" necessary copies"
|
||||||
Remote.showTriedRemotes bad
|
Remote.showTriedRemotes bad
|
||||||
Remote.showLocations key (have++skip)
|
Remote.showLocations key (have++skip)
|
||||||
|
"Rather than dropping this file, try using: git annex move"
|
||||||
hint
|
hint
|
||||||
return False
|
return False
|
||||||
where
|
where
|
||||||
|
|
|
@ -48,18 +48,20 @@ getKeyFile key file dest = dispatch =<< Remote.keyPossibilities key
|
||||||
where
|
where
|
||||||
dispatch [] = do
|
dispatch [] = do
|
||||||
showNote "not available"
|
showNote "not available"
|
||||||
Remote.showLocations key []
|
showlocs
|
||||||
return False
|
return False
|
||||||
dispatch remotes = trycopy remotes remotes
|
dispatch remotes = trycopy remotes remotes
|
||||||
trycopy full [] = do
|
trycopy full [] = do
|
||||||
Remote.showTriedRemotes full
|
Remote.showTriedRemotes full
|
||||||
Remote.showLocations key []
|
showlocs
|
||||||
return False
|
return False
|
||||||
trycopy full (r:rs) =
|
trycopy full (r:rs) =
|
||||||
ifM (probablyPresent r)
|
ifM (probablyPresent r)
|
||||||
( docopy r (trycopy full rs)
|
( docopy r (trycopy full rs)
|
||||||
, trycopy full rs
|
, trycopy full rs
|
||||||
)
|
)
|
||||||
|
showlocs = Remote.showLocations key [] $
|
||||||
|
"No other repository is known to contain the file."
|
||||||
-- This check is to avoid an ugly message if a remote is a
|
-- This check is to avoid an ugly message if a remote is a
|
||||||
-- drive that is not mounted.
|
-- drive that is not mounted.
|
||||||
probablyPresent r
|
probablyPresent r
|
||||||
|
|
|
@ -199,8 +199,8 @@ keyPossibilities' key trusted = do
|
||||||
return (sort validremotes, validtrusteduuids)
|
return (sort validremotes, validtrusteduuids)
|
||||||
|
|
||||||
{- Displays known locations of a key. -}
|
{- Displays known locations of a key. -}
|
||||||
showLocations :: Key -> [UUID] -> Annex ()
|
showLocations :: Key -> [UUID] -> String -> Annex ()
|
||||||
showLocations key exclude = do
|
showLocations key exclude nolocmsg = do
|
||||||
u <- getUUID
|
u <- getUUID
|
||||||
uuids <- keyLocations key
|
uuids <- keyLocations key
|
||||||
untrusteduuids <- trustGet UnTrusted
|
untrusteduuids <- trustGet UnTrusted
|
||||||
|
@ -211,7 +211,7 @@ showLocations key exclude = do
|
||||||
showLongNote $ message ppuuidswanted ppuuidsskipped
|
showLongNote $ message ppuuidswanted ppuuidsskipped
|
||||||
where
|
where
|
||||||
filteruuids l x = filter (`notElem` x) l
|
filteruuids l x = filter (`notElem` x) l
|
||||||
message [] [] = "No other repository is known to contain the file."
|
message [] [] = nolocmsg
|
||||||
message rs [] = "Try making some of these repositories available:\n" ++ rs
|
message rs [] = "Try making some of these repositories available:\n" ++ rs
|
||||||
message [] us = "Also these untrusted repositories may contain the file:\n" ++ us
|
message [] us = "Also these untrusted repositories may contain the file:\n" ++ us
|
||||||
message rs us = message rs [] ++ message [] us
|
message rs us = message rs [] ++ message [] us
|
||||||
|
|
1
debian/changelog
vendored
1
debian/changelog
vendored
|
@ -3,6 +3,7 @@ git-annex (3.20130108) UNRELEASED; urgency=low
|
||||||
* fsck: Better checking of file content in direct mode.
|
* fsck: Better checking of file content in direct mode.
|
||||||
* Special remotes now all rollback storage of keys that get modified
|
* Special remotes now all rollback storage of keys that get modified
|
||||||
during the transfer, which can happen in direct mode.
|
during the transfer, which can happen in direct mode.
|
||||||
|
* drop: Suggest using git annex move when numcopies prevents dropping a file.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Tue, 08 Jan 2013 12:37:38 -0400
|
-- Joey Hess <joeyh@debian.org> Tue, 08 Jan 2013 12:37:38 -0400
|
||||||
|
|
||||||
|
|
|
@ -62,3 +62,8 @@ Please provide any additional information below.
|
||||||
------------------------------------------------------------------
|
------------------------------------------------------------------
|
||||||
|
|
||||||
You can also reach me at ``jason@jasonwoof.com``
|
You can also reach me at ``jason@jasonwoof.com``
|
||||||
|
|
||||||
|
> [[done]]; the confusing message has been improved.
|
||||||
|
>
|
||||||
|
> BTW, you can use `git annex move` to ensure a file is on another repo and
|
||||||
|
> drop it locally. --[[Joey]]
|
||||||
|
|
Loading…
Reference in a new issue