summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
Diffstat (limited to 'Command')
-rw-r--r--Command/Sync.hs19
1 files changed, 17 insertions, 2 deletions
diff --git a/Command/Sync.hs b/Command/Sync.hs
index a89737647..28d7c69c5 100644
--- a/Command/Sync.hs
+++ b/Command/Sync.hs
@@ -6,7 +6,17 @@
- Licensed under the GNU GPL version 3 or higher.
-}
-module Command.Sync where
+module Command.Sync (
+ cmd,
+ prepMerge,
+ mergeLocal,
+ mergeRemote,
+ commitStaged,
+ pushBranch,
+ updateBranch,
+ syncBranch,
+ updateSyncBranch,
+) where
import Common.Annex
import Command
@@ -109,16 +119,21 @@ syncRemotes :: [String] -> Annex [Remote]
syncRemotes rs = ifM (Annex.getState Annex.fast) ( nub <$> pickfast , wanted )
where
pickfast = (++) <$> listed <*> (filterM good =<< fastest <$> available)
+
wanted
| null rs = filterM good =<< concat . Remote.byCost <$> available
| otherwise = listed
- listed = catMaybes <$> mapM (Remote.byName . Just) rs
+
+ listed = concat <$> mapM Remote.byNameOrGroup rs
+
available = filter (remoteAnnexSync . Remote.gitconfig)
. filter (not . Remote.isXMPPRemote)
<$> Remote.remoteList
+
good r
| Remote.gitSyncableRemote r = Remote.Git.repoAvail $ Remote.repo r
| otherwise = return True
+
fastest = fromMaybe [] . headMaybe . Remote.byCost
commit :: CommandStart