back to standard directory layout for webdav remotes

This allows deleting all chunks for a file with a single http command,
so it's a win after all.

However, does not look in the mixed case hash directories, which were
in the past used by the directory, etc remotes.
This commit is contained in:
Joey Hess 2012-11-16 18:09:28 -04:00
parent a1869ad662
commit 0b3126a30b

View file

@ -129,11 +129,11 @@ retrieveHelper r k saver = davAction r False $ \(baseurl, user, pass) -> liftIO
return True return True
remove :: Remote -> Key -> Annex Bool remove :: Remote -> Key -> Annex Bool
remove r k = davAction r False $ liftIO . go remove r k = davAction r False $ \(baseurl, user, pass) -> liftIO $ do
where -- Delete the key's whole directory, including any chunked
go (baseurl, user, pass) = do -- files, etc, in a single action.
let url = davLocation baseurl k let url = urlParent $ davLocation baseurl k
isJust <$> catchMaybeHttp (deleteContent url user pass) isJust <$> catchMaybeHttp (deleteContent url user pass)
checkPresent :: Remote -> Key -> Annex (Either String Bool) checkPresent :: Remote -> Key -> Annex (Either String Bool)
checkPresent r k = davAction r noconn $ \(baseurl, user, pass) -> do checkPresent r k = davAction r noconn $ \(baseurl, user, pass) -> do
@ -168,7 +168,7 @@ toDavPass = B8.fromString
{- The location to use to store a Key. -} {- The location to use to store a Key. -}
davLocation :: DavUrl -> Key -> DavUrl davLocation :: DavUrl -> Key -> DavUrl
davLocation baseurl k = davUrl baseurl $ hashDirLower k </> keyFile k davLocation baseurl k = davUrl baseurl $ annexLocation k hashDirLower
davUrl :: DavUrl -> FilePath -> DavUrl davUrl :: DavUrl -> FilePath -> DavUrl
davUrl baseurl file = baseurl </> file davUrl baseurl file = baseurl </> file