webdav: store temp file in same collection as the final export location

This may work better in some webdav server that gets confused at
cross-collection renamed. I don't know, let's find out.

The only real downside of doing this is that the temp files are not all
in the top-level collection, in case an interrupted run leaves one
behind. But that does not seem especially significant.
This commit is contained in:
Joey Hess 2021-03-12 14:52:24 -04:00
parent 6481991208
commit 4f49c29d20
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 64 additions and 1 deletions

View file

@ -212,7 +212,7 @@ storeExportDav :: DavHandleVar -> FilePath -> Key -> ExportLocation -> MeterUpda
storeExportDav hdl f k loc p = case exportLocation loc of
Right dest -> withDavHandle hdl $ \h -> runExport h $ \dav -> do
reqbody <- liftIO $ httpBodyStorer f p
storeHelper dav (keyTmpLocation k) dest reqbody
storeHelper dav (takeDirectory dest </> keyTmpLocation k) dest reqbody
Left err -> giveup err
retrieveExportDav :: DavHandleVar -> Key -> ExportLocation -> FilePath -> MeterUpdate -> Annex ()