summaryrefslogtreecommitdiff
path: root/Command/Sync.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2014-12-29 13:41:03 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2014-12-29 13:42:58 -0400
commit9315d96f700109da18f953534b0b5bab8d1440dd (patch)
tree62aa269152a1be8cab550fcff7732c29c9d6ad64 /Command/Sync.hs
parent17efa06748ddf67c0bc29359cedba381e7db4625 (diff)
sync: Now supports remote groups, the same way git remote update does.
Diffstat (limited to 'Command/Sync.hs')
-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