From 66cfb61912d2f7fc04b9716b82aad9b02096a6ad Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 13 Nov 2012 17:50:54 -0400 Subject: automatic repolist updating --- Assistant/DaemonStatus.hs | 5 ++++- Assistant/Threads/ConfigMonitor.hs | 5 +++-- Assistant/Types/DaemonStatus.hs | 3 +++ debian/changelog | 3 +++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Assistant/DaemonStatus.hs b/Assistant/DaemonStatus.hs index 8a4a7a16d..cb9133b2a 100644 --- a/Assistant/DaemonStatus.hs +++ b/Assistant/DaemonStatus.hs @@ -44,6 +44,7 @@ modifyDaemonStatus a = do sendNotification $ changeNotifier s return b + {- Returns a function that updates the lists of syncable remotes. -} calcSyncRemotes :: Annex (DaemonStatus -> DaemonStatus) calcSyncRemotes = do @@ -60,7 +61,9 @@ calcSyncRemotes = do {- Updates the sycRemotes list from the list of all remotes in Annex state. -} updateSyncRemotes :: Assistant () -updateSyncRemotes = modifyDaemonStatus_ =<< liftAnnex calcSyncRemotes +updateSyncRemotes = do + modifyDaemonStatus_ =<< liftAnnex calcSyncRemotes + liftIO . sendNotification =<< syncRemotesNotifier <$> getDaemonStatus {- Load any previous daemon status file, and store it in a MVar for this - process to use as its DaemonStatus. Also gets current transfer status. -} diff --git a/Assistant/Threads/ConfigMonitor.hs b/Assistant/Threads/ConfigMonitor.hs index 2d012ad80..47e197116 100644 --- a/Assistant/Threads/ConfigMonitor.hs +++ b/Assistant/Threads/ConfigMonitor.hs @@ -72,8 +72,9 @@ reloadConfigs changedconfigs = do sequence_ as void preferredContentMapLoad {- Changes to the remote log, or the trust log, can affect the - - syncRemotes list -} - when (Logs.Remote.remoteLog `elem` fs || Logs.Trust.trustLog `elem` fs) $ + - syncRemotes list. Changes to the uuid log may affect its + - display so are also included. -} + when (any (`elem` fs) [remoteLog, trustLog, uuidLog]) $ updateSyncRemotes where (fs, as) = unzip $ filter (flip S.member changedfiles . fst) diff --git a/Assistant/Types/DaemonStatus.hs b/Assistant/Types/DaemonStatus.hs index df0928d6e..7f868d957 100644 --- a/Assistant/Types/DaemonStatus.hs +++ b/Assistant/Types/DaemonStatus.hs @@ -47,6 +47,8 @@ data DaemonStatus = DaemonStatus , transferNotifier :: NotificationBroadcaster -- Broadcasts notifications when there's a change to the alerts , alertNotifier :: NotificationBroadcaster + -- Broadcasts notifications when the syncRemotes change + , syncRemotesNotifier :: NotificationBroadcaster } type TransferMap = M.Map Transfer TransferInfo @@ -70,3 +72,4 @@ newDaemonStatus = DaemonStatus <*> newNotificationBroadcaster <*> newNotificationBroadcaster <*> newNotificationBroadcaster + <*> newNotificationBroadcaster diff --git a/debian/changelog b/debian/changelog index 1114a45e4..4356bff1e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,9 @@ git-annex (3.20121113) UNRELEASED; urgency=low * Show error message to user when testing XMPP creds. * Fix build of assistant without yesod. + * webapp: The list of repositiories refreshes when new repositories are + added, including when new repository configurations are pushed in from + remotes. -- Joey Hess Tue, 13 Nov 2012 13:17:07 -0400 -- cgit v1.2.3