/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: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-06-01 21:57:00 UTC
  • mfrom: (7490.39.3 move-launchpad)
  • Revision ID: breezy.the.bot@gmail.com-20200601215700-joxuzo6w172gq74v
Move launchpad hoster support to the launchpad plugin.

Merged from https://code.launchpad.net/~jelmer/brz/move-launchpad/+merge/384931

Show diffs side-by-side

added added

removed removed

Lines of Context:
178
178
            # GitHub requires we lie.
179
179
            # https://github.com/dulwich/dulwich/issues/562
180
180
            headers["User-Agent"] = user_agent_for_github()
 
181
        elif host == "bazaar.launchpad.net":
 
182
            # Don't attempt Git probes against bazaar.launchpad.net; pad.lv/1744830
 
183
            raise brz_errors.NotBranchError(transport.base)
181
184
        resp = transport.request('GET', url, headers=headers)
182
185
        if resp.status in (404, 405):
183
186
            raise brz_errors.NotBranchError(transport.base)
184
 
        elif resp.status == 400 and resp.reason == 'no such method: info':
185
 
            # hgweb :(
186
 
            raise brz_errors.NotBranchError(transport.base)
187
187
        elif resp.status != 200:
188
 
            raise brz_errors.UnexpectedHttpStatus(url, resp.status)
 
188
            raise brz_errors.InvalidHttpResponse(
 
189
                url, 'Unable to handle http code %d' % resp.status)
189
190
 
190
191
        ct = resp.getheader("Content-Type")
191
192
        if ct and ct.startswith("application/x-git"):
420
421
def loggerhead_git_hook(branch_app, environ):
421
422
    branch = branch_app.branch
422
423
    config_stack = branch.get_config_stack()
423
 
    if not config_stack.get('git.http'):
 
424
    if config_stack.get('http_git'):
424
425
        return None
425
426
    from .server import git_http_hook
426
427
    return git_http_hook(branch, environ['REQUEST_METHOD'],