diff options
-rw-r--r-- | Logs/Web.hs | 27 | ||||
-rw-r--r-- | debian/changelog | 1 |
2 files changed, 17 insertions, 11 deletions
diff --git a/Logs/Web.hs b/Logs/Web.hs index 62656b7ed..bd8777250 100644 --- a/Logs/Web.hs +++ b/Logs/Web.hs @@ -23,21 +23,26 @@ type URLString = String webUUID :: UUID webUUID = UUID "00000000-0000-0000-0000-000000000001" -{- 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 </> keyFile key ++ ".log" -oldurlLog :: Key -> FilePath -{- A bug used to store the urls elsewhere. -} -oldurlLog key = "remote/web" </> hashDirLower key </> show key ++ ".log" +urlLog key = hashDirLower key </> keyFile key ++ ".log.web" + +{- Used to store the urls elsewhere. -} +oldurlLogs :: Key -> [FilePath] +oldurlLogs key = + [ "remote/web" </> hashDirLower key </> show key ++ ".log" + , "remote/web" </> hashDirLower key </> keyFile key ++ ".log" + ] {- Gets all urls that a key might be available from. -} getUrls :: Key -> Annex [URLString] -getUrls key = do - us <- currentLog (urlLog key) - if null us - then currentLog (oldurlLog key) - else return us +getUrls key = go $ urlLog key : oldurlLogs key + where + go [] = return [] + go (l:ls) = do + us <- currentLog l + if null us + then go ls + else return us {- Records a change in an url for a key. -} setUrl :: Key -> URLString -> LogStatus -> Annex () diff --git a/debian/changelog b/debian/changelog index 3315f8513..46d65df38 100644 --- a/debian/changelog +++ b/debian/changelog @@ -32,6 +32,7 @@ git-annex (3.20120124) UNRELEASED; urgency=low * addurl: Add --pathdepth option. * rekey: New plumbing level command, can be used to change the keys used for files en masse. + * Store web special remote url info in a more efficient location. -- Joey Hess <joeyh@debian.org> Tue, 24 Jan 2012 16:21:55 -0400 |