/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/_urllib.py

  • Committer: Vincent Ladeuil
  • Date: 2007-07-04 12:28:56 UTC
  • mfrom: (2584 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2646.
  • Revision ID: v.ladeuil+lp@free.fr-20070704122856-7jn5e6ou08ukimof
merge bzr.dev @ 2584 resolving conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
118
118
 
119
119
        return response
120
120
 
121
 
    def _get(self, relpath, ranges, tail_amount=0):
 
121
    def _get(self, relpath, offsets, tail_amount=0):
122
122
        """See HttpTransport._get"""
123
123
 
124
124
        abspath = self._remote_path(relpath)
125
125
        headers = {}
126
 
        if ranges or tail_amount:
127
 
            range_header = self.attempted_range_header(ranges, tail_amount)
 
126
        accepted_errors = [200, 404]
 
127
        if offsets or tail_amount:
 
128
            range_header = self._attempted_range_header(offsets, tail_amount)
128
129
            if range_header is not None:
 
130
                accepted_errors.append(206)
 
131
                accepted_errors.append(400)
129
132
                bytes = 'bytes=' + range_header
130
133
                headers = {'Range': bytes}
131
134
 
132
 
        request = Request('GET', abspath, None, headers)
 
135
        request = Request('GET', abspath, None, headers,
 
136
                          accepted_errors=accepted_errors)
133
137
        response = self._perform(request)
134
138
 
135
139
        code = response.code
162
166
        Performs the request and leaves callers handle the results.
163
167
        """
164
168
        abspath = self._remote_path(relpath)
165
 
        request = Request('HEAD', abspath)
 
169
        request = Request('HEAD', abspath,
 
170
                          accepted_errors=[200, 404])
166
171
        response = self._perform(request)
167
172
 
168
173
        self._get_connection().fake_close()
177
182
        if code == 200: # "ok",
178
183
            return True
179
184
        else:
180
 
            assert(code == 404, 'Only 200 or 404 are correct')
181
185
            return False
182
186
 
183
187