diff options
-rw-r--r-- | Remote.hs | 5 | ||||
-rw-r--r-- | Types/Remote.hs | 3 | ||||
-rw-r--r-- | debian/changelog | 1 |
3 files changed, 5 insertions, 4 deletions
@@ -45,6 +45,7 @@ import qualified Data.Map as M import Text.JSON import Text.JSON.Generic import Data.Tuple +import Data.Ord import Common.Annex import Types.Remote @@ -208,7 +209,7 @@ keyPossibilities' key trusted = do allremotes <- enabledRemoteList let validremotes = remotesWithUUID allremotes validuuids - return (sort validremotes, validtrusteduuids) + return (sortBy (comparing cost) validremotes, validtrusteduuids) {- Displays known locations of a key. -} showLocations :: Key -> [UUID] -> String -> Annex () @@ -249,7 +250,7 @@ logStatus remote key = logChange key (uuid remote) {- Orders remotes by cost, with ones with the lowest cost grouped together. -} byCost :: [Remote] -> [[Remote]] -byCost = map snd . sort . M.toList . costmap +byCost = map snd . sortBy (comparing fst) . M.toList . costmap where costmap = M.fromListWith (++) . map costpair costpair r = (cost r, [r]) diff --git a/Types/Remote.hs b/Types/Remote.hs index fe2260447..64a77109c 100644 --- a/Types/Remote.hs +++ b/Types/Remote.hs @@ -87,6 +87,5 @@ instance Show (RemoteA a) where instance Eq (RemoteA a) where x == y = uuid x == uuid y --- order remotes by cost instance Ord (RemoteA a) where - compare = comparing cost + compare = comparing uuid diff --git a/debian/changelog b/debian/changelog index 3cb1ec86b..4bf104386 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,6 +15,7 @@ git-annex (4.20130315) UNRELEASED; urgency=low with the problems Google Talk has with not always sending presence messages to clients. * map: Combine duplicate repositories, for a nicer looking map. + * Fix several bugs caused by a bad Ord instance for Remote. -- Joey Hess <joeyh@debian.org> Fri, 15 Mar 2013 00:10:07 -0400 |