b.s.r.SmartServerRepositoryGetStream(SmartServerRepositoryRequest) : class documentation

Part of bzrlib.smart.repository View In Hierarchy

Known subclasses: bzrlib.smart.repository.SmartServerRepositoryGetStream_1_19

No class docstring
Method do_repository_request Get a stream for inserting into a to_format repository.
Method do_body Called if the client sends a body with the request.
Method body_stream Undocumented
Method _should_fake_unknown Return True if we should return UnknownMethod to the client.

Inherited from SmartServerRepositoryRequest:

Method do Execute a repository request.
Method recreate_search Recreate a search from its serialised form.
Method recreate_search_from_recipe Recreate a specific revision search (vs a from-tip search).

Inherited from SmartServerRequest (via SmartServerRepositoryRequest):

Method __init__ Constructor.
Method execute Public entry point to execute this request.
Method do_chunk Called with each body chunk if the request has a streamed body.
Method do_end Called when the end of the request has been received.
Method setup_jail Undocumented
Method teardown_jail Undocumented
Method translate_client_path Translate a path received from a network client into a local
Method transport_from_client_path Get a backing transport corresponding to the location referred to by
Method _check_enabled Raises DisabledMethod if this method is disabled.
def do_repository_request(self, repository, to_network_name):
Get a stream for inserting into a to_format repository.

The request body is 'search_bytes', a description of the revisions being requested.

In 2.3 this verb added support for search_bytes == 'everything'. Older implementations will respond with a BadSearch error, and clients should catch this and fallback appropriately.

ParametersrepositoryThe repository to stream from.
to_network_nameThe network name of the format of the target repository.
def _should_fake_unknown(self):
Return True if we should return UnknownMethod to the client.

This is a workaround for bugs in pre-1.19 clients that claim to support receiving streams of CHK repositories. The pre-1.19 client expects inventory records to be serialized in the format defined by to_network_name, but in pre-1.19 (at least) that format definition tries to use the xml5 serializer, which does not correctly handle rich-roots. After 1.19 the client can also accept inventory-deltas (which avoids this issue), and those clients will use the Repository.get_stream_1.19 verb instead of this one. So: if this repository is CHK, and the to_format doesn't match, we should just fake an UnknownSmartMethod error so that the client will fallback to VFS, rather than sending it a stream we know it cannot handle.

def do_body(self, body_bytes):
Called if the client sends a body with the request.

The do() method is still called, and must have returned None.

Must return a SmartServerResponse.

def body_stream(self, stream, repository):
Undocumented
API Documentation for Bazaar, generated by pydoctor at 2020-07-02 03:56:49.