summaryrefslogtreecommitdiff
path: root/Logs/Web.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-11-29 17:01:07 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-11-29 17:01:07 -0400
commit3a69632859e929d3d2292da9528a89346b1602a2 (patch)
treec34884d1d1326cfe78f2209dde2d7377a5daf49f /Logs/Web.hs
parentd2ef4f93d1f4426f93020e56aeaea5e2ac8267c6 (diff)
dropping from web
Diffstat (limited to 'Logs/Web.hs')
-rw-r--r--Logs/Web.hs23
1 files changed, 10 insertions, 13 deletions
diff --git a/Logs/Web.hs b/Logs/Web.hs
index c2a4deb7d..7cfad8648 100644
--- a/Logs/Web.hs
+++ b/Logs/Web.hs
@@ -8,9 +8,9 @@
module Logs.Web (
URLString,
webUUID,
- setUrl,
+ getUrls,
setUrlPresent,
- getUrls
+ setUrlMissing,
) where
import Common.Annex
@@ -45,16 +45,13 @@ getUrls key = go $ urlLog key : oldurlLogs key
then go ls
else return us
-{- Records a change in an url for a key. -}
-setUrl :: Key -> URLString -> LogStatus -> Annex ()
-setUrl key url status = do
+setUrlPresent :: Key -> URLString -> Annex ()
+setUrlPresent key url = do
us <- getUrls key
- 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)
+ unless (url `elem` us) $ do
+ addLog (urlLog key) =<< logNow InfoPresent url
+ -- update location log to indicate that the web has the key
+ logChange key webUUID InfoPresent
-setUrlPresent :: Key -> URLString -> Annex ()
-setUrlPresent key url = setUrl key url InfoPresent
+setUrlMissing :: Key -> URLString -> Annex ()
+setUrlMissing key url = addLog (urlLog key) =<< logNow InfoMissing url