/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/transport/http/wsgi.py

  • Committer: Andrew Bennetts
  • Date: 2007-12-14 01:43:48 UTC
  • mto: This revision was merged to the branch mainline in revision 3320.
  • Revision ID: andrew.bennetts@canonical.com-20071214014348-xj6q4064e27mw3gl
Improve comments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
116
116
            return []
117
117
 
118
118
        relpath = environ['bzrlib.relpath']
119
 
        # 1. subtract HTTP path from rcp ("adjusted rcp")
120
 
        #    1a.  If HTTP path unconsumed, clone backing transport with
121
 
        #         remainder ("adjusted transport")
122
 
        # 2. feed HPSS request path + adjusted/backing transport + adjusted
123
 
        #    rcp?
124
119
 
125
120
        if not relpath.startswith('/'):
126
121
            relpath = '/' + relpath
127
122
        if not relpath.endswith('/'):
128
123
            relpath += '/'
129
124
 
130
 
        # (relpath='/foo/bar/', rcp='/foo/' -> (rp 'bar', arcp '/')
131
 
        #  relpath='/foo/', rcp='/foo/bar/' -> (rp '/', arcp '/bar')
 
125
        # Compare the HTTP path (relpath) and root_client_path, and calculate
 
126
        # new relpath and root_client_path accordingly, to be used to build the
 
127
        # request.
132
128
        if relpath.startswith(self.root_client_path):
133
 
            # The entire root client path is part of the relpath.
 
129
            # The relpath traverses all of the mandatory root client path.
 
130
            # Remove the root_client_path from the relpath, and set
 
131
            # adjusted_tcp to None to tell the request handler that no further
 
132
            # path translation is required.
134
133
            adjusted_rcp = None
135
 
            # Consume the relpath part we just subtracted
136
134
            adjusted_relpath = relpath[len(self.root_client_path):]
137
135
        elif self.root_client_path.startswith(relpath):
138
136
            # The relpath traverses some of the mandatory root client path.
139
 
            # Subtract relpath from HTTP request
 
137
            # Subtract the relpath from the root_client_path, and set the
 
138
            # relpath to '.'.
140
139
            adjusted_rcp = '/' + self.root_client_path[len(relpath):]
141
 
            # The entire relpath was consumed.
142
140
            adjusted_relpath = '.'
143
141
        else:
144
142
            adjusted_rcp = self.root_client_path