Merge lp://staging/~spiv/loggerhead/branchwsgiapp-refactor into lp://staging/loggerhead
Status: | Merged |
---|---|
Approved by: | Jelmer Vernooij |
Approved revision: | 450 |
Merged at revision: | 450 |
Proposed branch: | lp://staging/~spiv/loggerhead/branchwsgiapp-refactor |
Merge into: | lp://staging/loggerhead |
Diff against target: |
90 lines (+22/-13) 2 files modified
loggerhead/apps/branch.py (+6/-3) loggerhead/controllers/__init__.py (+16/-10) |
To merge this branch: | bzr merge lp://staging/~spiv/loggerhead/branchwsgiapp-refactor |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jelmer Vernooij | Approve | ||
Review via email: mp+66143@code.staging.launchpad.net |
Commit message
Refactor BranchWSGIApp.app and TemplatedBranch
Description of the change
These are some refactorings introduced in lp:~spiv/loggerhead/jsonify.
It extracts a lookup_app method from BranchWSGIApp.app, for better testability.
It also extracts parse_args and add_template_values methods from TemplatedBranch
There are some small behaviour changes, but we think they're ok:
* BranchWSGIApp.app holds a branch lock read from earlier, and even does so for static files. However read locks are cheap, and in fact this will bring a branch.get_config() call inside the read lock which is probably a good thing.
* add_template_values now overrides values from get_values rather than the other way around. In practice they are always the same (and the jsonify branch will remove many of the unnecessary duplication of these values).