summaryrefslogtreecommitdiff
path: root/Logs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-10-15 16:36:56 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-10-15 16:36:56 -0400
commitec169f84b1cc140b6d4c316fbd0e8407297d038a (patch)
treeb28d538df9249c7f03581696d23a9371e7ec9ffb /Logs
parentb4015064e1492c6591f69499d8d745989999ba53 (diff)
migrate: Copy url logs for keys when migrating.
Diffstat (limited to 'Logs')
-rw-r--r--Logs/Web.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Logs/Web.hs b/Logs/Web.hs
index ff8fbdb6b..4c8ef7fc0 100644
--- a/Logs/Web.hs
+++ b/Logs/Web.hs
@@ -9,6 +9,7 @@ module Logs.Web (
URLString,
webUUID,
setUrl,
+ setUrlPresent,
getUrls
) where
@@ -31,6 +32,7 @@ oldurlLog :: Key -> FilePath
{- A bug used to store the urls elsewhere. -}
oldurlLog key = "remote/web" </> hashDirLower key </> show key ++ ".log"
+{- Gets all urls that a key might be available from. -}
getUrls :: Key -> Annex [URLString]
getUrls key = do
us <- currentLog (urlLog key)
@@ -47,3 +49,6 @@ setUrl key url status = do
-- update location log to indicate that the web has the key, or not
us <- getUrls key
logChange g key webUUID (if null us then InfoMissing else InfoPresent)
+
+setUrlPresent :: Key -> URLString -> Annex ()
+setUrlPresent key url = setUrl key url InfoPresent