diff options
Diffstat (limited to 'Remote/Web.hs')
-rw-r--r-- | Remote/Web.hs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Remote/Web.hs b/Remote/Web.hs index 2f8fac23b..cd028a06d 100644 --- a/Remote/Web.hs +++ b/Remote/Web.hs @@ -67,10 +67,17 @@ gen r _ _ = {- The urls for a key are stored in remote/web/hash/key.log - in the git-annex branch. -} urlLog :: Key -> FilePath -urlLog key = "remote/web" </> hashDirLower key </> show key ++ ".log" +urlLog key = "remote/web" </> hashDirLower key </> keyFile key ++ ".log" +oldurlLog :: Key -> FilePath +{- A bug used to store the urls elsewhere. -} +oldurlLog key = "remote/web" </> hashDirLower key </> show key ++ ".log" getUrls :: Key -> Annex [URLString] -getUrls key = currentLog (urlLog key) +getUrls key = do + us <- currentLog (urlLog key) + if null us + then currentLog (oldurlLog key) + else return us {- Records a change in an url for a key. -} setUrl :: Key -> URLString -> LogStatus -> Annex () |