~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2007-06-01 10:02:05 UTC
  • mto: (2485.8.44 bzr.connection.sharing)
  • mto: This revision was merged to the branch mainline in revision 2646.
  • Revision ID: v.ladeuil+lp@free.fr-20070601100205-i8hq7x0zm8k79g90
Finish http refactoring. Test suite passing.

* bzrlib/transport/http/_pycurl.py: 
Replaces _real_abspath by _unqualified_abspath.

* bzrlib/transport/http/_urllib.py:
Replaces _real_abspath by _unqualified_abspath.

* bzrlib/transport/http/__init__.py:
(HttpTransportBase.abspath): Deleted.
(HttpTransportBase._unqualified_abspath): Kind of _remote_path for
hhtp, replaces _real_abspath.

* bzrlib/tests/test_http.py:
(TestHttpTransportUrls.test_invalid_http_urls): Delete the test
for directories, we are not listable anyway.

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
            self._connection = None
65
65
            self._opener = self._opener_class()
66
66
 
67
 
            authuri = extract_authentication_uri(self._real_abspath(self._path))
 
67
            authuri = extract_authentication_uri(self._unqualified_abspath(self._path))
68
68
            self._auth = {'user': user, 'password': password,
69
69
                          'authuri': authuri}
70
70
            if user and password is not None: # '' is a valid password
105
105
            raise errors.RedirectRequested(request.get_full_url(),
106
106
                                           request.redirected_to,
107
107
                                           is_permament=(code == 301),
108
 
                                           qual_proto=self._qualified_proto)
 
108
                                           qual_proto=self._scheme)
109
109
 
110
110
        if request.redirected_to is not None:
111
111
            mutter('redirected from: %s to: %s' % (request.get_full_url(),
116
116
    def _get(self, relpath, ranges, tail_amount=0):
117
117
        """See HttpTransport._get"""
118
118
 
119
 
        abspath = self._real_abspath(relpath)
 
119
        abspath = self._unqualified_abspath(relpath)
120
120
        headers = {}
121
121
        if ranges or tail_amount:
122
122
            range_header = self.attempted_range_header(ranges, tail_amount)
138
138
        return code, data
139
139
 
140
140
    def _post(self, body_bytes):
141
 
        abspath = self._real_abspath('.bzr/smart')
 
141
        abspath = self._unqualified_abspath('.bzr/smart')
142
142
        response = self._perform(Request('POST', abspath, body_bytes))
143
143
        code = response.code
144
144
        data = handle_response(abspath, code, response.headers, response)
156
156
 
157
157
        Performs the request and leaves callers handle the results.
158
158
        """
159
 
        abspath = self._real_abspath(relpath)
 
159
        abspath = self._unqualified_abspath(relpath)
160
160
        request = Request('HEAD', abspath)
161
161
        response = self._perform(request)
162
162