Mercurial > hg
diff tests/test-wireproto-caching.t @ 40178:46a40bce3ae0
wireprotov2: define and implement "filesdata" command
Previously, the only way to access file revision data was the
"filedata" command. This command is useful to have. But, it only
allowed resolving revision data for a single file. This meant that
clients needed to send 1 command for each tracked path they were
seeking data on. Furthermore, those commands would need to enumerate
the exact file nodes they wanted data for.
This approach meant that clients were sending a lot of data to
remotes in order to request file data. e.g. if there were 1M
file revisions, we'd need at least 20,000,000 bytes just to encode
file nodes! Many clients on the internet don't have that kind of
upload capacity.
In order to limit the amount of data that clients must send, we'll
need more efficient ways to request repository data.
This commit defines and implements a new "filesdata" command. This
command allows the retrieval of data for multiple files by specifying
changeset revisions and optional file patterns. The command figures
out what file revisions are "relevant" and sends them in bulk.
The logic around choosing which file revisions to send in the case of
haveparents not being set is overly simple and will over-send files. We
will need more smarts here eventually. (Specifically, the client will
need to tell the server which revisions it knows about.) This work
is deferred until a later time.
Differential Revision: https://phab.mercurial-scm.org/D4981
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 03 Oct 2018 12:54:39 -0700 |
parents | 41263df08109 |
children | ed55a0077490 |
line wrap: on
line diff
--- a/tests/test-wireproto-caching.t Tue Oct 02 10:31:36 2018 -0700 +++ b/tests/test-wireproto-caching.t Wed Oct 03 12:54:39 2018 -0700 @@ -273,6 +273,38 @@ b'pull' ] }, + b'filesdata': { + b'args': { + b'fields': { + b'default': set([]), + b'required': False, + b'type': b'set', + b'validvalues': set([ + b'firstchangeset', + b'parents', + b'revision' + ]) + }, + b'haveparents': { + b'default': False, + b'required': False, + b'type': b'bool' + }, + b'pathfilter': { + b'default': None, + b'required': False, + b'type': b'dict' + }, + b'revisions': { + b'required': True, + b'type': b'list' + } + }, + b'permissions': [ + b'pull' + ], + b'recommendedbatchsize': 50000 + }, b'heads': { b'args': { b'publiconly': {