Commit graph

20903 commits

Author SHA1 Message Date
Joey Hess
6bfc3cf3be re-evil-splicved new version of DAV 2014-08-10 20:01:54 -04:00
Joey Hess
3f661d54d8 Merge branch 'master' of ssh://git-annex.branchable.com 2014-08-10 19:58:20 -04:00
Joey Hess
800f8f1028 giving up on windows autobuilder until its HP can be upgraded 2014-08-10 19:56:55 -04:00
https://id.koumbit.net/anarcat
6332d7161e icing 2014-08-10 23:56:48 +00:00
https://id.koumbit.net/anarcat
34f5beaaef always set the playcount to some numeric value, 0 if we fail 2014-08-10 23:48:06 +00:00
Joey Hess
b3a9d41910 fix build 2014-08-10 19:44:09 -04:00
Joey Hess
b011439d2f Merge branch 'master' of ssh://git-annex.branchable.com 2014-08-10 19:41:41 -04:00
Joey Hess
fb66ee8c85 qualify catch and try
got a build failure on android due to there being a Prelude.catch
2014-08-10 19:40:21 -04:00
https://id.koumbit.net/anarcat
5141e53ca2 rename tips/dumb_metadata_extraction_from_xbmc/git-annex-xbmc-playcount.pl.pl to tips/dumb_metadata_extraction_from_xbmc/git-annex-xbmc-playcount.pl 2014-08-10 23:35:43 +00:00
https://id.koumbit.net/anarcat
fd2546dafb trying script upload from the web interface, neat 2014-08-10 23:33:36 +00:00
https://id.koumbit.net/anarcat
ae30cba464 this is degenerate, but should work 2014-08-10 23:32:47 +00:00
Joey Hess
29aa5e82dc trying to work around a dep problem on windows 2014-08-10 19:26:03 -04:00
Joey Hess
f709c786d9 stop nuking cabal 2014-08-10 16:23:25 -04:00
Joey Hess
d8240ca1c1 nuke cabal on windows, so it will build new DAV 2014-08-10 16:06:20 -04:00
Joey Hess
c27d9f909b fix windows build 2014-08-10 15:30:55 -04:00
Joey Hess
54b74ef8db Merge branch 'master' of ssh://git-annex.branchable.com 2014-08-10 15:20:03 -04:00
Joey Hess
dc2155c2b8 devblog 2014-08-10 15:17:59 -04:00
Joey Hess
c78a7aa1e1 unlock of not present file should still be a failure, just not a crash 2014-08-10 15:16:24 -04:00
Joey Hess
6adbd50cd9 testremote: Add testing of behavior when remote is not available
Added a mkUnavailable method, which a Remote can use to generate a version
of itself that is not available. Implemented for several, but not yet all
remotes.

This allows testing that checkPresent properly throws an exceptions when
it cannot check if a key is present or not. It also allows testing that the
other methods don't throw exceptions in these circumstances.

This immediately found several bugs, which this commit also fixes!

* git remotes using ssh accidentially had checkPresent return
  an exception, rather than throwing it
* The chunking code accidentially returned False rather than
  propigating an exception when there were no chunks and
  checkPresent threw an exception for the non-chunked key.

This commit was sponsored by Carlo Matteo Capocasa.
2014-08-10 15:02:59 -04:00
http://svario.it/gioele
0da82b1d68 Explain the problem better 2014-08-10 15:57:33 +00:00
Joey Hess
2fd9518f72 unlock: Better error handling; continue past files that are not available or cannot be unlocked due to disk space, and try all specified files. 2014-08-09 11:09:54 -04:00
Joey Hess
f69a9274f9 avoid printing really ugly webdav exceptions
The responseheaders can sometimes include the entire input request,
which is several pages of garbage.
2014-08-09 01:38:13 -04:00
Joey Hess
81e1b2078e devblog 2014-08-08 23:25:48 -04:00
Joey Hess
1412056b20 Merge branch 'newchunks' 2014-08-08 23:25:38 -04:00
Joey Hess
4f1ba9a23d fix checkPresent error handling for non-present local git repos
guardUsable r (error "foo") *returned* an error, rather than throwing it
2014-08-08 19:18:08 -04:00
Joey Hess
1dd3232e8e check for 200 response 2014-08-08 17:17:36 -04:00
Joey Hess
1f8c170c95 http-conduit not used for dav 2014-08-08 17:17:23 -04:00
Joey Hess
0260ee43e6 fix removeKey when not present 2014-08-08 14:57:05 -04:00
Joey Hess
6cb9e5c32f show missing url= parameter error sooner 2014-08-08 14:19:08 -04:00
Joey Hess
ec11e0b89a fix build warning 2014-08-08 13:55:09 -04:00
Joey Hess
2d344edf60 increave dav build-dep 2014-08-08 13:47:44 -04:00
Joey Hess
c3f8512475 WebDAV: Avoid buffering whole file in memory when downloading.
httpBodyRetriever will later also be used by S3

This commit was sponsored by Ethan Aubin.
2014-08-08 13:40:55 -04:00
Joey Hess
fc17cf852e further break out legacy chunking code 2014-08-08 13:17:24 -04:00
Joey Hess
871b6cb886 DAV version turns out to be 1.0. 2014-08-08 12:50:51 -04:00
https://www.google.com/accounts/o8/id?id=AItOawmvzzyDA8uXFz8yokeCrepbh8PwWe_WrjE
d8a865a397 Added a comment: a more recent fork 2014-08-08 16:03:24 +00:00
https://www.google.com/accounts/o8/id?id=AItOawmvzzyDA8uXFz8yokeCrepbh8PwWe_WrjE
5c24841d37 Added a comment: current status? 2014-08-08 16:00:18 +00:00
Joey Hess
d3d30d2bf3 need transformers for Utility.Exception 2014-08-07 22:11:28 -04:00
Joey Hess
c784ef4586 unify exception handling into Utility.Exception
Removed old extensible-exceptions, only needed for very old ghc.

Made webdav use Utility.Exception, to work after some changes in DAV's
exception handling.

Removed Annex.Exception. Mostly this was trivial, but note that
tryAnnex is replaced with tryNonAsync and catchAnnex replaced with
catchNonAsync. In theory that could be a behavior change, since the former
caught all exceptions, and the latter don't catch async exceptions.

However, in practice, nothing in the Annex monad uses async exceptions.
Grepping for throwTo and killThread only find stuff in the assistant,
which does not seem related.

Command.Add.undo is changed to accept a SomeException, and things
that use it for rollback now catch non-async exceptions, rather than
only IOExceptions.
2014-08-07 22:03:29 -04:00
Joey Hess
8e3d62dd5d generalized using the extensions package 2014-08-07 21:01:07 -04:00
Joey Hess
a619175732 devbog 2014-08-07 19:57:55 -04:00
Joey Hess
2dd8dab314 WebDAV: Avoid buffering whole file in memory when uploading.
The httpStorer will later also be used by S3.

This commit was sponsored by Torbjørn Thorsen.
2014-08-07 19:32:23 -04:00
Joey Hess
fc4b3cdcce webdav: reuse http connection when operating on the chunks of a file
For both new and legacy chunks.

Massive speed up!

This commit was sponsored by Dominik Wagenknecht.
2014-08-07 18:33:14 -04:00
Joey Hess
0b1b85d9ea use DAV monad
This speeds up the webdav special remote somewhat, since it often now
groups actions together in a single http connection when eg, storing a
file.

Legacy chunks are still supported, but have not been sped up.

This depends on a as-yet unreleased version of DAV.

This commit was sponsored by Thomas Hochstein.
2014-08-07 17:32:57 -04:00
Joey Hess
2a94853e75 Merge branch 'master' of ssh://git-annex.branchable.com 2014-08-06 18:40:49 -04:00
Joey Hess
7e55fe6a1f devblog 2014-08-06 18:33:20 -04:00
Joey Hess
aacb0b2823 convert WebDAV to new special remote interface, adding new-style chunking support
Reusing http connection when operating on chunks is not done yet,
I had to submit some patches to DAV to support that. However, this is no
slower than old-style chunking was.

Note that it's a fileRetriever and a fileStorer, despite DAV using
bytestrings that would allow streaming. As a result, upload/download of
encrypted files is made a bit more expensive, since it spools them to temp
files. This was needed to get the progress meters to work.

There are probably ways to avoid that.. But it turns out that the current
DAV interface buffers the whole file content in memory, and I have
sent in a patch to DAV to improve its interfaces. Using the new interfaces,
it's certainly going to need to be a fileStorer, in order to read the file
size from the file (getting the size of a bytestring would destroy
laziness). It should be possible to use the new interface to make it be a
byteRetriever, so I'll change that when I get to it.

This commit was sponsored by Andreas Olsson.
2014-08-06 16:57:06 -04:00
Joey Hess
8025decc7f run Preparer to get Remover and CheckPresent actions
This will allow special remotes to eg, open a http connection and reuse it,
while checking if chunks are present, or removing chunks.

S3 and WebDAV both need this to support chunks with reasonable speed.

Note that a special remote might want to cache a http connection across
multiple requests. A simple case of this is that CheckPresent is typically
called before Store or Remove. A remote using this interface can certianly
use a Preparer that eg, uses a MVar to cache a http connection.

However, it's up to the remote to then deal with things like stale or
stalled http connections when eg, doing a series of downloads from a remote
and other places. There could be long delays between calls to a remote,
which could lead to eg, http connection stalls; the machine might even
move to a new network, etc.

It might be nice to improve this interface later to allow
the simple case without needing to handle the full complex case.
One way to do it would be to have a `Transaction SpecialRemote cache`,
where SpecialRemote contains methods for Storer, Retriever, Remover, and
CheckPresent, that all expect to be passed a `cache`.
2014-08-06 14:28:36 -04:00
Joey Hess
b4cf22a388 pushed checkPresent exception handling out of Remote implementations
I tend to prefer moving toward explicit exception handling, not away from
it, but in this case, I think there are good reasons to let checkPresent
throw exceptions:

1. They can all be caught in one place (Remote.hasKey), and we know
   every possible exception is caught there now, which we didn't before.
2. It simplified the code of the Remotes. I think it makes sense for
   Remotes to be able to be implemented without needing to worry about
   catching exceptions inside them. (Mostly.)
3. Types.StoreRetrieve.Preparer can only work on things that return a
   Bool, which all the other relevant remote methods already did.
   I do not see a good way to generalize that type; my previous attempts
   failed miserably.
2014-08-06 13:45:19 -04:00
Joey Hess
781833b16f update for change in bup remote removal 2014-08-06 13:45:05 -04:00
gernot
70740bcc55 2014-08-06 12:53:04 +00:00