From 23d2519be1c77492e0e265512593457c7f44cdf1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 16 Jan 2015 13:29:54 -0400 Subject: [PATCH] Fix wording of message displayed when unable to get a file that is available in untrusted repositories. --- Command/Drop.hs | 2 +- Command/Get.hs | 2 +- Remote.hs | 8 +++++--- debian/changelog | 2 ++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Command/Drop.hs b/Command/Drop.hs index 9460c47b4e..3779b3459b 100644 --- a/Command/Drop.hs +++ b/Command/Drop.hs @@ -156,7 +156,7 @@ notEnoughCopies key need have skip bad = do show (length have) ++ " out of " ++ show (fromNumCopies need) ++ " necessary copies" Remote.showTriedRemotes bad - Remote.showLocations key (have++skip) + Remote.showLocations True key (have++skip) "Rather than dropping this file, try using: git annex move" hint return False diff --git a/Command/Get.hs b/Command/Get.hs index a49c7c409c..2213e32fb6 100644 --- a/Command/Get.hs +++ b/Command/Get.hs @@ -79,7 +79,7 @@ getKeyFile' key afile dest = dispatch ( docopy r witness <||> trycopy full rs witness , trycopy full rs witness ) - showlocs = Remote.showLocations key [] + showlocs = Remote.showLocations False 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. diff --git a/Remote.hs b/Remote.hs index 24923337ba..a48c5f75e5 100644 --- a/Remote.hs +++ b/Remote.hs @@ -272,11 +272,13 @@ keyPossibilities' key trusted = do return (sortBy (comparing cost) validremotes, validtrusteduuids) {- Displays known locations of a key. -} -showLocations :: Key -> [UUID] -> String -> Annex () -showLocations key exclude nolocmsg = do +showLocations :: Bool -> Key -> [UUID] -> String -> Annex () +showLocations separateuntrusted key exclude nolocmsg = do u <- getUUID uuids <- keyLocations key - untrusteduuids <- trustGet UnTrusted + untrusteduuids <- if separateuntrusted + then trustGet UnTrusted + else pure [] let uuidswanted = filteruuids uuids (u:exclude++untrusteduuids) let uuidsskipped = filteruuids uuids (u:exclude++uuidswanted) ppuuidswanted <- prettyPrintUUIDs "wanted" uuidswanted diff --git a/debian/changelog b/debian/changelog index 4d27f6fb70..9216968fde 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,8 @@ git-annex (5.20150114) UNRELEASED; urgency=medium made after two LOSTNET messages were received in a row (perhaps due to two different network interfaces being brought down). * Fix build failure when wget is not installed. + * Fix wording of message displayed when unable to get a file that + is available in untrusted repositories. -- Joey Hess Tue, 13 Jan 2015 17:03:39 -0400