/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 breezy/git/__init__.py

  • Committer: Jelmer Vernooij
  • Date: 2019-05-19 22:07:15 UTC
  • mto: This revision was merged to the branch mainline in revision 7302.
  • Revision ID: jelmer@jelmer.uk-20190519220715-f1qr56p0letrs1yt
Add a urllib3-like interface.

Show diffs side-by-side

added added

removed removed

Lines of Context:
160
160
        headers = {"Content-Type": "application/x-git-upload-pack-request",
161
161
                   "Accept": "application/x-git-upload-pack-result",
162
162
                   }
163
 
        req = Request('GET', url, accepted_errors=[200, 403, 404, 405],
164
 
                      headers=headers)
165
163
        (scheme, user, password, host, port,
166
 
         path) = urlutils.parse_url(req.get_full_url())
 
164
         path) = urlutils.parse_url(url)
167
165
        if host == "github.com":
168
166
            # GitHub requires we lie.
169
167
            # https://github.com/dulwich/dulwich/issues/562
171
169
        elif host == "bazaar.launchpad.net":
172
170
            # Don't attempt Git probes against bazaar.launchpad.net; pad.lv/1744830
173
171
            raise brz_errors.NotBranchError(transport.base)
174
 
        resp = transport._perform(req)
175
 
        if resp.code in (404, 405):
 
172
        resp = transport.request('GET', url, headers=headers)
 
173
        if resp.status in (404, 405):
176
174
            raise brz_errors.NotBranchError(transport.base)
 
175
        else:
 
176
            raise errors.InvalidHttpResponse(
 
177
                url, 'Unable to handle http code %d' % resp.status)
 
178
 
177
179
        headers = resp.headers
178
180
        ct = headers.get("Content-Type")
179
181
        if ct is None: