diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-08-17 12:26:14 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-08-17 13:54:14 -0400 |
commit | da0a1360d7b57d034620338996552752ab873045 (patch) | |
tree | 7cd5d994f15ae0d52e18321a129360b9e39a6d7d /Assistant/Sync.hs | |
parent | 13ce429b5cbc3036e24613ce85e17af7acd9a480 (diff) |
add annex-ignore-command and annex-sync-command configs
Added remote configuration settings annex-ignore-command and
annex-sync-command, which are dynamic equivilants of the annex-ignore
and annex-sync configurations.
For this I needed a new DynamicConfig infrastructure. Its implementation
should be as fast as before when there is no dynamic config, and it caches
so shell commands are only run once.
Note that annex-ignore-command exits nonzero when the remote should be ignored.
While that may seem backwards, it allows using the same command for it as
for annex-sync-command when you want to disable both.
This commit was sponsored by Trenton Cronholm on Patreon.
Diffstat (limited to 'Assistant/Sync.hs')
-rw-r--r-- | Assistant/Sync.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Assistant/Sync.hs b/Assistant/Sync.hs index e6a5bc5d5..aba90f64c 100644 --- a/Assistant/Sync.hs +++ b/Assistant/Sync.hs @@ -27,6 +27,7 @@ import Annex.TaggedPush import Annex.Ssh import qualified Config import Git.Config +import Config.DynamicConfig import Assistant.NamedThread import Assistant.Threads.Watcher (watchThread, WatcherControl(..)) import Assistant.TransferSlots @@ -77,8 +78,8 @@ reconnectRemotes rs = void $ do go = do (failed, diverged) <- sync =<< liftAnnex (join Command.Sync.getCurrBranch) - addScanRemotes diverged $ - filter (not . remoteAnnexIgnore . Remote.gitconfig) + addScanRemotes diverged =<< + filterM (not <$$> liftIO . getDynamicConfig . remoteAnnexIgnore . Remote.gitconfig) nonxmppremotes return failed signal r = liftIO . mapM_ (flip tryPutMVar ()) |