From e36bfabb0e56087771d385a9f4ecdb342f1f14db Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 9 Oct 2015 15:14:25 -0400 Subject: improve message when drop failed due to no locked copy --- Annex/NumCopies.hs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'Annex') diff --git a/Annex/NumCopies.hs b/Annex/NumCopies.hs index f6ce05230..b51d3815b 100644 --- a/Annex/NumCopies.hs +++ b/Annex/NumCopies.hs @@ -175,10 +175,14 @@ instance Exception DropException notEnoughCopies :: Key -> NumCopies -> [VerifiedCopy] -> [UUID] -> [Remote] -> String -> Annex () notEnoughCopies key need have skip bad nolocmsg = do showNote "unsafe" - showLongNote $ - "Could only verify the existence of " ++ - show (length have) ++ " out of " ++ show (fromNumCopies need) ++ - " necessary copies" + if length have < fromNumCopies need + then showLongNote $ + "Could only verify the existence of " ++ + show (length have) ++ " out of " ++ show (fromNumCopies need) ++ + " necessary copies" + else do + showLongNote "Unable to lock down 1 copy of file that is required to safely drop it." + showLongNote "(This could have happened because of a concurrent drop, or because a remote has too old a version of git-annex-shell installed.)" Remote.showTriedRemotes bad Remote.showLocations True key (map toUUID have++skip) nolocmsg -- cgit v1.2.3