aboutsummaryrefslogtreecommitdiff
path: root/Remote.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-02-01 10:33:55 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-02-01 10:33:55 -0400
commit6f622c6043ad8db9f27a16020c371af68506e8e7 (patch)
treeff3ac9ebc96979f98220dc15ca7356c3a0906022 /Remote.hs
parentcf46308597d8633cc7bad9687f7f0baf91e14992 (diff)
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.
Diffstat (limited to 'Remote.hs')
-rw-r--r--Remote.hs10
1 files changed, 9 insertions, 1 deletions
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