From 6f622c6043ad8db9f27a16020c371af68506e8e7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 1 Feb 2014 10:33:55 -0400 Subject: improve sync with xmpp and annex-ignore * sync --content: Honor annex-ignore configuration. * sync: Don't try to sync with xmpp remotes, which are only currently supported when using the assistant. --- Remote.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Remote.hs') diff --git a/Remote.hs b/Remote.hs index 3c838a623..f2af025fb 100644 --- a/Remote.hs +++ b/Remote.hs @@ -41,7 +41,8 @@ module Remote ( showLocations, forceTrust, logStatus, - checkAvailable + checkAvailable, + isXMPPRemote ) where import qualified Data.Map as M @@ -60,6 +61,7 @@ import Logs.Location hiding (logStatus) import Remote.List import Config import Git.Types (RemoteName) +import qualified Git {- Map from UUIDs of Remotes to a calculated value. -} remoteMap :: (Remote -> a) -> Annex (M.Map UUID a) @@ -292,3 +294,9 @@ byCost = map snd . sortBy (comparing fst) . M.toList . costmap checkAvailable :: Bool -> Remote -> IO Bool checkAvailable assumenetworkavailable = maybe (return assumenetworkavailable) doesDirectoryExist . localpath + +{- Remotes using the XMPP transport have urls like xmpp::user@host -} +isXMPPRemote :: Remote -> Bool +isXMPPRemote remote = Git.repoIsUrl r && "xmpp::" `isPrefixOf` Git.repoLocation r + where + r = repo remote -- cgit v1.2.3