From 0fada4380884758e1e51bff6f8ca708f07425e40 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 17 Feb 2012 23:58:56 -0400 Subject: avoid unnecessary log changes when re-adding the same url --- Logs/Web.hs | 10 ++++++---- 1 file 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 -- cgit v1.2.3