Part of lp.codehosting.vfs View In Hierarchy
This server provides a VFS that backs onto a transport that stores branches by id. The TransportDispatch object takes care of showing a writeable or read-only view of each branch as appropriate.
In addition to basic VFS operations, this server provides operations for
creating a branch and requesting for a branch to be mirrored. The
associated transport, AsyncLaunchpadTransport
, has hooks in certain
filesystem-level operations to trigger these.
Method | __init__ | Construct a LaunchpadServer . |
Method | createBranch | Make a new directory for the given virtual URL fragment. |
Method | branchChanged | Notify Launchpad of a change to the a branch. |
Method | unexpectedError | Undocumented |
Method | _normalize_stacked_on_url | Normalize and return the stacked-on location of branch . |
Inherited from _BaseLaunchpadServer:
Method | translateVirtualPath | See AsyncVirtualServer.translateVirtualPath . |
Inherited from AsyncVirtualServer (via _BaseLaunchpadServer):
Method | get_url | Return the URL of this server. |
Method | start_server | See Server.start_server. |
Method | stop_server | See Server.stop_server. |
Method | _transportFactory | Create a transport for this server pointing at url . |
LaunchpadServer
.
See _BaseLaunchpadServer
for more information.
Parameters | codehosting_api | An object that has 'createBranch' and 'branchChanged' methods in addition to a 'translatePath' method. These methods should return Deferreds. XXX: JonathanLange 2008-11-19: Specify this interface better. |
user_id | The database ID of the user to connect as. | |
branch_transport | A Bazaar Transport that points to the
"hosted" area of Launchpad. See module docstring for more
information. | |
seen_new_branch_hook | A callable that will be called once for each branch accessed via this server. |
If virtual_url_fragment
is a branch directory, create the branch in
the database, then create a matching directory on the backing
transport.
Parameters | virtual_url_fragment | A virtual path to be translated. |
Raises | NotABranchPath | If virtual_path does not have at least a
valid path to a branch. |
NotEnoughInformation | If virtual_path does not map to a
branch. | |
PermissionDenied | If the branch cannot be created in the database. This might indicate that the branch already exists, or that its creation is forbidden by a policy. | |
Fault | If the XML-RPC server raises errors. |
branch
.
In the common case, branch
will either be unstacked or stacked on a
relative path, in which case this is very easy: just return the
location.
If branch
is stacked on the absolute URL of another Launchpad
branch, we normalize this to a relative path (mutating the branch) and
return the relative path.
If branch
is stacked on some other absolute URL we don't recognise,
we just return that and rely on the branchChanged
XML-RPC method
recording a complaint in the appropriate place.
This method tries hard to not exit via an exception, because the client side experience is not good in that case. Instead, log.err() is called, which will result in an OOPS being logged.
Parameters | virtual_url_fragment | A url fragment that points to a path owned by a branch. |