summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-02-17 23:58:56 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-02-17 23:58:56 -0400
commit0fada4380884758e1e51bff6f8ca708f07425e40 (patch)
treebba547b25cad58736c1565a649a4c28fc9597124
parent5bf07b3b5c9a798c3a50a775f42888e497f48732 (diff)
avoid unnecessary log changes when re-adding the same url
-rw-r--r--Logs/Web.hs10
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