summaryrefslogtreecommitdiff
path: root/Remote
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-11-16 18:09:28 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-11-16 18:14:07 -0400
commit1c866d1e00523f346ad875908a11b6c93181915b (patch)
tree07259b09954382957e65883fef6eea10a84d2769 /Remote
parent81bd9c24326319fc2d47c9dcdd6f2d680130771a (diff)
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.
Diffstat (limited to 'Remote')
-rw-r--r--Remote/WebDAV.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/Remote/WebDAV.hs b/Remote/WebDAV.hs
index 5af209ba8..c1e221295 100644
--- a/Remote/WebDAV.hs
+++ b/Remote/WebDAV.hs
@@ -129,11 +129,11 @@ retrieveHelper r k saver = davAction r False $ \(baseurl, user, pass) -> liftIO
return True
remove :: Remote -> Key -> Annex Bool
-remove r k = davAction r False $ liftIO . go
- where
- go (baseurl, user, pass) = do
- let url = davLocation baseurl k
- isJust <$> catchMaybeHttp (deleteContent url user pass)
+remove r k = davAction r False $ \(baseurl, user, pass) -> liftIO $ do
+ -- Delete the key's whole directory, including any chunked
+ -- files, etc, in a single action.
+ let url = urlParent $ davLocation baseurl k
+ isJust <$> catchMaybeHttp (deleteContent url user pass)
checkPresent :: Remote -> Key -> Annex (Either String Bool)
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. -}
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 baseurl file = baseurl </> file