Part of lp.codehosting.rewrite View In Hierarchy
Method | __init__ | |
Method | rewriteLine | Rewrite 'resource_location' to a more concrete location. |
Method | _codebrowse_url | Undocumented |
Method | _getBranchIdAndTrailingPath | Return the branch id and trailing path for 'location'. |
Parameters | logger | Logger that messages about what the rewriter is doing will be sent to. |
proxy | A blocking proxy for a branchfilesystem endpoint. |
In addition this method returns whether the answer can from the cache or from the database.
We use the 'translatePath' BranchFileSystemClient method. There are three cases:
The request is for something within the .bzr directory of a branch.
In this case we rewrite the request to the location from which branches are served by ID.
The request is for something within a branch, but not the .bzr directory.
In this case, we hand the request off to codebrowse.
The branch is not found. Two sub-cases: the request is for a product control directory or the we don't know how to translate the path.
In both these cases we return 'NULL' which indicates to Apache that we don't know how to rewrite the request (and so it should go on to generate a 404 response).
Other errors are allowed to propagate, on the assumption that the caller will catch and log them.