l.c.v._.BranchFileSystemClient : class documentation

Part of lp.codehosting.vfs View In Hierarchy

Wrapper for some methods of the codehosting endpoint.

Instances of this class wrap the methods of the codehosting endpoint required by the VFS code, specialized for a particular user.

The wrapper also caches the results of calls to translatePath in order to avoid a large number of roundtrips. In the normal course of operation, our Bazaar transport translates virtual paths to real paths on disk using this client. It does this many, many times for a single Bazaar operation, so we cache the results here.

Method __init__ Construct a caching codehosting_endpoint.
Method createBranch Create a Launchpad IBranch in the database.
Method branchChanged Mark a branch as needing to be mirrored.
Method translatePath Translate 'path'.
Method _getMatchedPart Return the part of 'path' that the endpoint actually matched.
Method _addToCache Cache the given 'transport_tuple' results for 'path'.
Method _getFromCache Get the cached 'transport_tuple' for 'path'.
def __init__(self, codehosting_endpoint, user_id, expiry_time=None, seen_new_branch_hook=None, _now=time.time):
Construct a caching codehosting_endpoint.
Parameterscodehosting_endpointAn XML-RPC proxy that implements callRemote and returns Deferreds.
user_idThe database ID of the user who will be making these requests. An integer.
expiry_timeIf supplied, only cache the results of translatePath for this many seconds. If not supplied, cache the results of translatePath for as long as this instance exists.
seen_new_branch_hookA callable that will be called with the unique_name of each new branch that is accessed.
def _getMatchedPart(self, path, transport_tuple):
Return the part of 'path' that the endpoint actually matched.
def _addToCache(self, transport_tuple, path):
Cache the given 'transport_tuple' results for 'path'.
Returnsthe 'transport_tuple' as given, so we can use this as a callback.
def _getFromCache(self, path):
Get the cached 'transport_tuple' for 'path'.
def createBranch(self, branch_path):
Create a Launchpad IBranch in the database.

This raises any Faults that might be raised by the codehosting_endpoint's createBranch method, so for more information see IBranchFileSystem.createBranch.

Parametersbranch_pathThe path to the branch to create.
ReturnsA Deferred that fires the ID of the created branch.
def branchChanged(self, branch_id, stacked_on_url, last_revision_id, control_string, branch_string, repository_string):
Mark a branch as needing to be mirrored.
Parametersbranch_idThe database ID of the branch.
def translatePath(self, path):
Translate 'path'.
API Documentation for Launchpad, generated by pydoctor at 2018-05-27 00:00:04.