diff options
author | Joey Hess <joey@kitenet.net> | 2012-02-17 23:58:56 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-02-17 23:58:56 -0400 |
commit | 0fada4380884758e1e51bff6f8ca708f07425e40 (patch) | |
tree | bba547b25cad58736c1565a649a4c28fc9597124 /Logs | |
parent | 5bf07b3b5c9a798c3a50a775f42888e497f48732 (diff) |
avoid unnecessary log changes when re-adding the same url
Diffstat (limited to 'Logs')
-rw-r--r-- | Logs/Web.hs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Logs/Web.hs b/Logs/Web.hs index bd8777250..5a2f6e57e 100644 --- a/Logs/Web.hs +++ b/Logs/Web.hs @@ -47,11 +47,13 @@ getUrls key = go $ urlLog key : oldurlLogs key {- Records a change in an url for a key. -} setUrl :: Key -> URLString -> LogStatus -> Annex () setUrl key url status = do - addLog (urlLog key) =<< logNow status url - - -- update location log to indicate that the web has the key, or not us <- getUrls key - logChange key webUUID (if null us then InfoMissing else InfoPresent) + unless (status == InfoPresent && url `elem` us) $ do + addLog (urlLog key) =<< logNow status url + + -- update location log to indicate that the web has the key, or not + us <- getUrls key + logChange key webUUID (if null us then InfoMissing else InfoPresent) setUrlPresent :: Key -> URLString -> Annex () setUrlPresent key url = setUrl key url InfoPresent |