Mercurial > public > mercurial-scm > hg-stable
diff mercurial/help/internals/wireprotocolv2.txt @ 40329:ed55a0077490
wireprotov2: implement command for retrieving raw store files
Implementing shallow clone of the changelog is hard. We want the 4.8
release to have a fast implementation of partial clone in wireprotov2. In
order to achieve fast, we can't use deltas for transferring changelog and
manifestlog data.
Per discussions at the 4.8 sprint, this commit implements a somwwhat hacky
and likely-to-be-changed-drastically-or-dropped command in wireprotov2 that
facilitates access to raw store files, namely the changelog and manifestlog.
Using this command, clients can perform a "stream clone" of sorts for just
the changelog and manifestlog. This will allow clients to fetch the changelog
and manifest revlogs, stream them to disk (which should be fast), then follow
up filesdata requests for files revision data for a particular changeset.
Differential Revision: https://phab.mercurial-scm.org/D5134
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Tue, 16 Oct 2018 21:31:21 +0200 |
parents | 46a40bce3ae0 |
children | abbd077965c0 |
line wrap: on
line diff
--- a/mercurial/help/internals/wireprotocolv2.txt Tue Oct 16 21:35:33 2018 +0200 +++ b/mercurial/help/internals/wireprotocolv2.txt Tue Oct 16 21:31:21 2018 +0200 @@ -606,6 +606,51 @@ TODO consider using binary to represent nodes is certain pushkey namespaces. TODO better define response type and meaning. +rawstorefiledata +---------------- + +Allows retrieving raw files used to store repository data. + +The command accepts the following arguments: + +files + (array of bytestring) Describes the files that should be retrieved. + + The meaning of values in this array is dependent on the storage backend used + by the server. + +The response bytestream starts with a CBOR map describing the data that follows. +This map has the following bytestring keys: + +filecount + (unsigned integer) Total number of files whose data is being transferred. + +totalsize + (unsigned integer) Total size in bytes of files data that will be + transferred. This is file on-disk size and not wire size. + +Following the map header are N file segments. Each file segment consists of a +CBOR map followed by an indefinite length bytestring. Each map has the following +bytestring keys: + +location + (bytestring) Denotes the location in the repository where the file should be + written. Values map to vfs instances to use for the writing. + +path + (bytestring) Path of file being transferred. Path is the raw store + path and can be any sequence of bytes that can be tracked in a Mercurial + manifest. + +size + (unsigned integer) Size of file data. This will be the final written + file size. The total size of the data that follows the CBOR map + will be greater due to encoding overhead of CBOR. + +TODO this command is woefully incomplete. If we are to move forward with a +stream clone analog, it needs a lot more metadata around how to describe what +files are available to retrieve, other semantics. + Revision Specifiers ===================