avoid showing web special remote in sync alert

This commit is contained in:
Joey Hess 2013-03-28 14:51:39 -04:00
parent 75a1c2f91a
commit 24d1ec760d

View file

@ -158,22 +158,25 @@ pushToRemotes' now notifypushes remotes = do
- XMPP remotes are handled specially; since the action can only start - XMPP remotes are handled specially; since the action can only start
- an async process for them, they are not included in the alert, but are - an async process for them, they are not included in the alert, but are
- still passed to the action. - still passed to the action.
-
- Readonly remotes are also hidden (to hide the web special remote).
-} -}
syncAction :: [Remote] -> ([Remote] -> Assistant [Remote]) -> Assistant [Remote] syncAction :: [Remote] -> ([Remote] -> Assistant [Remote]) -> Assistant [Remote]
syncAction rs a syncAction rs a
| null nonxmppremotes = a rs | null visibleremotes = a rs
| otherwise = do | otherwise = do
i <- addAlert $ syncAlert nonxmppremotes i <- addAlert $ syncAlert visibleremotes
failed <- a rs failed <- a rs
let failed' = filter (not . Git.repoIsLocalUnknown . Remote.repo) failed let failed' = filter (not . Git.repoIsLocalUnknown . Remote.repo) failed
let succeeded = filter (`notElem` failed) nonxmppremotes let succeeded = filter (`notElem` failed) visibleremotes
if null succeeded && null failed' if null succeeded && null failed'
then removeAlert i then removeAlert i
else updateAlertMap $ mergeAlert i $ else updateAlertMap $ mergeAlert i $
syncResultAlert succeeded failed' syncResultAlert succeeded failed'
return failed return failed
where where
nonxmppremotes = filter (not . isXMPPRemote) rs visibleremotes = filter (not . Remote.readonly) $
filter (not . isXMPPRemote) rs
{- Manually pull from remotes and merge their branches. Returns any {- Manually pull from remotes and merge their branches. Returns any
- remotes that it failed to pull from, and a Bool indicating - remotes that it failed to pull from, and a Bool indicating