summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-01-09 18:53:59 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-01-09 18:53:59 -0400
commitc81444bea5d4c90681434dff5fc00948333b4a10 (patch)
treec7cb1a7d5117455fd4f14054b613fe0f6fa0fe96
parent0c893f8743bab81077e3ee0fed0993b746d7a269 (diff)
drop: Suggest using git annex move when numcopies prevents dropping a file.
-rw-r--r--Command/Drop.hs1
-rw-r--r--Command/Get.hs6
-rw-r--r--Remote.hs6
-rw-r--r--debian/changelog1
-rw-r--r--doc/bugs/drop_fails_to_see_copies_that_whereis_sees.mdwn5
5 files changed, 14 insertions, 5 deletions
diff --git a/Command/Drop.hs b/Command/Drop.hs
index 3a30703d5..2552b3d37 100644
--- a/Command/Drop.hs
+++ b/Command/Drop.hs
@@ -133,6 +133,7 @@ notEnoughCopies key need have skip bad = do
" necessary copies"
Remote.showTriedRemotes bad
Remote.showLocations key (have++skip)
+ "Rather than dropping this file, try using: git annex move"
hint
return False
where
diff --git a/Command/Get.hs b/Command/Get.hs
index 1295cdeeb..9c58bde64 100644
--- a/Command/Get.hs
+++ b/Command/Get.hs
@@ -48,18 +48,20 @@ getKeyFile key file dest = dispatch =<< Remote.keyPossibilities key
where
dispatch [] = do
showNote "not available"
- Remote.showLocations key []
+ showlocs
return False
dispatch remotes = trycopy remotes remotes
trycopy full [] = do
Remote.showTriedRemotes full
- Remote.showLocations key []
+ showlocs
return False
trycopy full (r:rs) =
ifM (probablyPresent r)
( docopy r (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
-- drive that is not mounted.
probablyPresent r
diff --git a/Remote.hs b/Remote.hs
index 8b1d7cd61..456716c6e 100644
--- a/Remote.hs
+++ b/Remote.hs
@@ -199,8 +199,8 @@ keyPossibilities' key trusted = do
return (sort validremotes, validtrusteduuids)
{- Displays known locations of a key. -}
-showLocations :: Key -> [UUID] -> Annex ()
-showLocations key exclude = do
+showLocations :: Key -> [UUID] -> String -> Annex ()
+showLocations key exclude nolocmsg = do
u <- getUUID
uuids <- keyLocations key
untrusteduuids <- trustGet UnTrusted
@@ -211,7 +211,7 @@ showLocations key exclude = do
showLongNote $ message ppuuidswanted ppuuidsskipped
where
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 [] us = "Also these untrusted repositories may contain the file:\n" ++ us
message rs us = message rs [] ++ message [] us
diff --git a/debian/changelog b/debian/changelog
index 8c292e927..c2fa135d2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ git-annex (3.20130108) UNRELEASED; urgency=low
* fsck: Better checking of file content in direct mode.
* Special remotes now all rollback storage of keys that get modified
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
diff --git a/doc/bugs/drop_fails_to_see_copies_that_whereis_sees.mdwn b/doc/bugs/drop_fails_to_see_copies_that_whereis_sees.mdwn
index 5c45d4c15..59b76c92b 100644
--- a/doc/bugs/drop_fails_to_see_copies_that_whereis_sees.mdwn
+++ b/doc/bugs/drop_fails_to_see_copies_that_whereis_sees.mdwn
@@ -62,3 +62,8 @@ Please provide any additional information below.
------------------------------------------------------------------
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]]