~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/apps/transport.py

Don't use Repository.get_revision_inventory(), removed in bzr 2.2. (#528194)

(The original commit message is wrong: The replacement is named get_inventory, not get_revision.)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008-2011 Canonical Ltd.
 
1
# Copyright (C) 2008, 2009 Canonical Ltd.
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
28
28
from paste import httpexceptions
29
29
from paste import urlparser
30
30
 
31
 
from loggerhead import util
32
31
from loggerhead.apps.branch import BranchWSGIApp
33
32
from loggerhead.apps import favicon_app, robots_app, static_app
34
33
from loggerhead.controllers.directory_ui import DirectoryUI
35
34
 
36
 
# TODO: Use bzrlib.ui.bool_from_string(), added in bzr 1.18
37
35
_bools = {
38
36
    'yes': True, 'no': False,
39
37
    'on': True, 'off': False,
69
67
    def app_for_non_branch(self, environ):
70
68
        segment = path_info_pop(environ)
71
69
        if segment is None:
72
 
            raise httpexceptions.HTTPMovedPermanently.relative_redirect(
73
 
                environ['SCRIPT_NAME'] + '/', environ)
 
70
            raise httpexceptions.HTTPMovedPermanently(
 
71
                environ['SCRIPT_NAME'] + '/')
74
72
        elif segment == '':
75
73
            if self.name:
76
74
                name = self.name
95
93
            # TODO: Use something here that uses the transport API
96
94
            # rather than relying on the local filesystem API.
97
95
            base = self.transport.base
 
96
            readonly_prefix = 'readonly+'
 
97
            if base.startswith(readonly_prefix):
 
98
                base = base[len(readonly_prefix):]
98
99
            try:
99
 
                path = util.local_path_from_url(base)
 
100
                path = urlutils.local_path_from_url(base)
100
101
            except errors.InvalidURL:
101
102
                raise httpexceptions.HTTPNotFound()
102
103
            else: