From 6e213d04f1233af3faffcd49acf479be086c71f4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 27 May 2012 20:55:56 -0400 Subject: sync: Show a nicer message if a user tries to sync to a special remote. --- Command/Sync.hs | 9 ++++++++- debian/changelog | 6 ++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Command/Sync.hs b/Command/Sync.hs index b9ef0bc97..5fb49d30c 100644 --- a/Command/Sync.hs +++ b/Command/Sync.hs @@ -57,10 +57,17 @@ syncRemotes rs = ifM (Annex.getState Annex.fast) ( nub <$> pickfast , wanted ) wanted | null rs = good =<< concat . byspeed <$> available | otherwise = listed - listed = catMaybes <$> mapM (Remote.byName . Just) rs + listed = do + l <- catMaybes <$> mapM (Remote.byName . Just) rs + let s = filter special l + unless (null s) $ + error $ "cannot sync special remotes: " ++ + unwords (map Types.Remote.name s) + return l available = filter nonspecial <$> Remote.enabledRemoteList good = filterM $ Remote.Git.repoAvail . Types.Remote.repo nonspecial r = Types.Remote.remotetype r == Remote.Git.remote + special = not . nonspecial fastest = fromMaybe [] . headMaybe . byspeed byspeed = map snd . sort . M.toList . costmap costmap = M.fromListWith (++) . map costpair diff --git a/debian/changelog b/debian/changelog index 99594c351..9c38d1727 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +git-annex (3.20120523) UNRELEASED; urgency=low + + * sync: Show a nicer message if a user tries to sync to a special remote. + + -- Joey Hess Sun, 27 May 2012 20:55:29 -0400 + git-annex (3.20120522) unstable; urgency=low * Pass -a to cp even when it supports --reflink=auto, to preserve -- cgit v1.2.3