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.
This commit is contained in:
Joey Hess 2014-02-01 10:33:55 -04:00
parent 8bbe4ff934
commit bbef0cddfd
8 changed files with 23 additions and 16 deletions

View file

@ -55,7 +55,7 @@ calcSyncRemotes = do
let good r = Remote.uuid r `elem` alive
let syncable = filter good rs
let syncdata = filter (not . remoteAnnexIgnore . Remote.gitconfig) $
filter (not . isXMPPRemote) syncable
filter (not . Remote.isXMPPRemote) syncable
return $ \dstatus -> dstatus
{ syncRemotes = syncable
@ -257,11 +257,5 @@ alertDuring alert a = do
i <- addAlert $ alert { alertClass = Activity }
removeAlert i `after` a
{- 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 = Remote.repo remote
getXMPPClientID :: Remote -> ClientID
getXMPPClientID r = T.pack $ drop (length "xmpp::") (Git.repoLocation (Remote.repo r))