Part of lp.codehosting.vfs View In Hierarchy
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'. |
Parameters | codehosting_endpoint | An XML-RPC proxy that implements callRemote and returns Deferreds. |
user_id | The database ID of the user who will be making these requests. An integer. | |
expiry_time | If 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_hook | A callable that will be called with the unique_name of each new branch that is accessed. |
Returns | the 'transport_tuple' as given, so we can use this as a callback. |
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
.
Parameters | branch_path | The path to the branch to create. |
Returns | A Deferred that fires the ID of the created branch. |