diff --git a/Assistant/Sync.hs b/Assistant/Sync.hs index c6460e9ed0..5f08ec81ca 100644 --- a/Assistant/Sync.hs +++ b/Assistant/Sync.hs @@ -35,6 +35,7 @@ import Assistant.TransferQueue import Assistant.RepoProblem import Assistant.Commits import Types.Transfer +import Database.Export import Data.Time.Clock import qualified Data.Map as M @@ -218,6 +219,8 @@ manualPull currentbranch remotes = do forM_ normalremotes $ \r -> liftAnnex $ Command.Sync.mergeRemote r currentbranch Command.Sync.mergeConfig def + when haddiverged $ + updateExportTreeFromLogAll return (catMaybes failed, haddiverged) where wantpull gc = remoteAnnexPull gc @@ -264,3 +267,9 @@ changeSyncFlag r enabled = do void Remote.remoteListRefresh where key = Config.remoteConfig (Remote.repo r) "sync" + +updateExportTreeFromLogAll :: Assistant () +updateExportTreeFromLogAll = do + rs <- exportRemotes <$> getDaemonStatus + forM_ rs $ \r -> liftAnnex $ + openDb (Remote.uuid r) >>= updateExportTreeFromLog diff --git a/Assistant/Threads/Merger.hs b/Assistant/Threads/Merger.hs index 5d40edea74..ff2fdc9a00 100644 --- a/Assistant/Threads/Merger.hs +++ b/Assistant/Threads/Merger.hs @@ -10,6 +10,7 @@ module Assistant.Threads.Merger where import Assistant.Common import Assistant.TransferQueue import Assistant.BranchChange +import Assistant.Sync import Utility.DirWatcher import Utility.DirWatcher.Types import qualified Annex.Branch @@ -62,7 +63,8 @@ onChange file | isAnnexBranch file = do branchChanged diverged <- liftAnnex Annex.Branch.forceUpdate - when diverged $ + when diverged $ do + updateExportTreeFromLogAll queueDeferredDownloads "retrying deferred download" Later | otherwise = mergecurrent where