Commit Graph

15 Commits

Author SHA1 Message Date
Olivier Trempe
8005fc4b2f fileserverclient: add wireproto command for requesting a filelog's heads
Allowing discovery of all the heads of a filelog allows supporting some existing
Mercurial use cases, like viewing all the versions of a file in a UI.
2016-08-02 10:40:42 -07:00
Martin von Zweigbergk
14962d6e74 fileserverclient: make iterbatch() case work with new store
The iterbatch() handling added in f93aa99d4f1e (fileserverclient: use
new iterbatch() method, 2016-03-22) was broken by 31e88bf6faf0 (store:
change fileserviceclient to write via new store, 2016-04-04). Fix it
by copying the pattern introduced elsewhere in that change.
2016-05-18 22:39:20 -07:00
Durham Goode
77a1e268d2 tests: update tests to include cg3 in header
Upstream added a new changegroup format, so our headers changed slightly.
2016-01-19 16:34:20 -08:00
Laurent Charignon
d6539aeb26 test: change output of test-http.t
Summary:
This seems similar to t9539553, the patch is just the change of the
test output, it seems like we changed some bundle related code in core.

Test Plan: test pass

Reviewers: ericsumner, durham

Differential Revision: https://phabricator.fb.com/D2794159
2015-12-30 12:39:14 -08:00
Eric Sumner
9d009eb59f generaldelta now on by default 2015-12-08 09:55:10 -08:00
Eric Sumner
14962f53b8 test: URL parameters could come in either order
This is being generated by iterating over a dict, which isn't stable.
2015-11-04 12:56:01 -08:00
Augie Fackler
4451faca7e test-http: save access log and make sure we actually use request batching 2015-08-21 12:51:40 -04:00
Augie Fackler
226a6f1027 fileserverclient: add config knob to control batch size
Previously we'd just send one enormous batch for everything to the
server. This led to prolonged periods of no progress output for the
user. Now we send batches in smaller chunks (default is 100) which
gives the user some idea that things are working.

Includes a trivial test, which doesn't really verify that the batching
logic is used as described, but at least prevents the boneheaded error
I had in an earlier (unmailed) version of this patch which forgot to
use configint() when loading the config setting.
2015-08-18 15:14:01 -04:00
Augie Fackler
51f7cac5a7 getfile: add error reporting to getfile method
Without this, the only way to report a failure of a file load in a
batched set of getfile requests is to fail the entire batch, which is
potentially painful. Instead, add our own error reporting in-band
which the client can then detect and raise.

I'm not completely happy with the somewhat adhoc error reporting here,
but we expect our server to have at least one additional error ("not
allowed to see file contents") which will require some special
handling on our end, so we need some level of flexibility in the error
reporting protocol so we can extend it later. Sigh.

Open question: should we reserve some range of error codes so that
it's easy for strange custom servers to have related monkeypatches to
client code for custom handling of unforseen-by-remotefilelog
conditions?

I couldn't figure out how to actually get the client to try loading
file contents over http in the test, but the get-with-headers test at
least proves that the server responses look the way I expect.
2015-08-04 14:59:53 -04:00
Augie Fackler
16310f95f3 remotefilelog: introduce new getfile method
Right now, this is a naive fetch-one-file method. The next change will
mark the method as batchable and use a batch in the client so that
many files can be requested in a single RPC.
2015-06-30 17:32:31 -04:00
Augie Fackler
882ca8e705 remotefilelogserver: prevent getfiles from being called over http at all
This means that even old clients that fail to sniff for capabilities
before trying getfiles will get a sensible error message back from the
server.
2015-06-30 11:04:47 -04:00
Augie Fackler
dd2e200ad1 fileserverclient: sniff for remotefilelog capability before using it
This prevents clients from causing a server problem on an http server.
2015-06-29 17:33:56 -04:00
Augie Fackler
32cb84c8b7 remotefilelogserver: restrict remotefilelog capability to ssh
This only works over ssh, so let's not pretend otherwise.

A future change will ensure the capability is still advertised via ssh.
2015-06-29 17:36:25 -04:00
Augie Fackler
5a72282b12 remotefilelogserver: wrap wireproto._capabilities
If we instead wrap wireproto.capabilities, then our capabilities don't
get transmitted via the hello command, so not all clients will notice
the new capability unless we do the wrapping here.

Test output is in the test that previously demonstrated the
defect. Note that there's still a defect: we're advertising the
capability over http even though we have no hope of the getfiles
method working over http.
2015-06-29 17:35:32 -04:00
Augie Fackler
965e22e01f test-http: new test that demonstrates a few defects
1) The client doesn't look-before-you-leap on the remotefilelog capability

2) The http server crashes ungracefully when handling a remotefilelog
request (ideally it should respond with '400 No Such Method' as a
server without the extension would.)

3) capabilities are inconsistently advertised between cmd=hello and
cmd=capabilities.

Future patches will attempt to clean up most of this.
2015-06-29 16:43:54 -04:00